主要内容

Using permute and ipermute

The commands permute and ipermute are generalizations of transpose, which exchanges the rows and columns of a two-dimensional matrix.

permute(A,ORDER) rearranges the dimensions of A so that they are in the order specified by the vector ORDER. The array produced has the same values of A but the order of the subscripts needed to access any particular element are rearranged as specified by ORDER. The elements of ORDER must be a rearrangement of the numbers from 1 to N.

All of the uncertain objects are essentially 2-dimensional (output and input) operators with array dependence. This means that the first 2 dimensions are treated differently from dimensions 3 and beyond. It is not permissible to permute across these groups.

For uss and ufrd, the restriction is built into the syntax. The elements of the ORDER vector only refer to array dimensions. Therefore, there is no possibility of permute across these dimensions. In you need to permute the first two dimensions, use the command transpose instead.

For umat, the restriction is enforced in the software. The elements of the ORDER vector refer to all dimensions. However, the first two elements of ORDER must be a rearrangement of the numbers 1 and 2. The remaining elements of ORDER must be a rearrangement of the numbers 3 through N. If either of those conditions fail, an error is generated. Hence, for umat arrays, either permute or transpose can be used to effect the transpose operation.