flipdim flip x block components along a given dimension Calling Sequence y = flipdim(x, dim [,sb]) Arguments x, y scalars, vectors, matrices, or hypermatrices of any type, of same sizes dim a positive integer, the dimension number along which the flipping should occur sb a positive integer, the size of the blocks to permute Description 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.