X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=blobdiff_plain;f=scilab%2Fmodules%2Felementary_functions%2Fhelp%2Fen_US%2Fmatrixmanipulation%2Fflipdim.xml;h=4a463cbd6d1161bf50147c4656b7d862575a0a5b;hp=c2832beabc722f0437e9749f431a6239f859714c;hb=9485573bcc9aea503595598efbe518b15ac78bc1;hpb=d00f9f4abd48265c58737315c5d6edc1acfb219d diff --git a/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml b/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml index c2832be..4a463cb 100644 --- a/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml +++ b/scilab/modules/elementary_functions/help/en_US/matrixmanipulation/flipdim.xml @@ -2,42 +2,43 @@ flipdim - flip x components along a given dimension + flip x block components along a given dimension Calling Sequence - y=flipdim(x,dim) + y = flipdim(x, dim [,sb]) Arguments - x + x, y - a scalar, a vector or an array of real or complex numbers. + scalars, vectors, matrices, or hypermatrices of any type, of same sizes dim - a positive integer + a positive integer, the dimension number along which the flipping should occur - y + sb - a scalar, a vector or an array of reals + a positive integer, the size of the blocks to permute @@ -45,35 +46,87 @@ Description - Given x, a scalar/vector/array of real or complex numbers and - dim a positive integer, this function flips the x - components along the dimension number dim of - x (x and y have - the same size) + Given x, a scalar/vector/matrix/hypermatrix of any type and + two positive integers dim and sb, + this function flips the x components by blocks of size sb + along the dimension number dim of x + (x and y have the same size). + + + The optional parameter sb (for Size Block) allows flipping + x by blocks of size sb*size(x,2) + (dim=1) or size(x,1)*sb (dim=2). Examples - 0) +y = flipdim(x, 2) + +// Texts: +x = matrix(strsplit("a":"x", 1:23), 4, 6); +x = x+x +flipdim(x, 2) + +// Polynomials: +x = inv_coeff(grand(3, 9, "uin", 0, 3), 2) +flipdim(x, 1) +// Rationals: +n = inv_coeff(grand(3, 9, "uin", 0, 3), 2); +d = inv_coeff(grand(3, 9, "uin", 0, 3), 2); +r = n./d +flipdim(r, 2) ]]> + + Examples using sb: + + [10 11 8 9 6 7 4 5 2 3 0 1] // Block size = 2. +flipdim(X, 2, 3) // => [9 10 11 6 7 8 3 4 5 0 1 2] +flipdim(X, 2, 4) // => [8 9 10 11 4 5 6 7 0 1 2 3] +flipdim(X, 2, 6) // => [6 7 8 9 10 11 0 1 2 3 4 5] + +// Error if sb does not divide the targeted dimension of x. +y = flipdim(x, 2, 5); // size(X) = [1 12] and sb=5 does not divide 12. + ]]> + + + History + + + 5.5.0 + + Extension from decimals to any type: booleans, integers, strings, polynomials and rationals. + New input argument sb to flip x blockwise. + + +