| DSP Blockset | Search  Help Desk |
| Permute Matrix | See Also |
Reorder the rows or columns of a matrix.
Library
Matrix Functions, in Math FunctionsDescription
The Permute Matrix block reorders the rows or columns of the input matrix (A) as indicated by the indexing vector (P). When the Permute parameter is set to Rows, the block uses the rows of A to create a new matrix with the same column dimension. Vector P indicates where each row from A should be placed in the output matrix. The number of rows in the output matrix is determined by the number of elements in P.% equivalent MATLAB code y = [A(P(1),:) ; A(P(2),:) ; A(P(3),:) ; ... ; A(P(end),:)]As shown below, rows of A can appear any number of times in the output, or not at all.

When the Permute parameter is set to Columns, the block uses the columns of A to create a new matrix with the same row dimension. Vector P indicates where each column from A should be placed in the output matrix. The number of columns in the output matrix is determined by the number of elements in P.
% equivalent MATLAB code y = [a(:,p(1)) a(:,p(2)) a(:,p(3)) ... a(:,p(end))]Columns of A can appear any number of times in the output, or not at all.

When an element in the vector P references a non-existent row or column of matrix A, the block reacts with the behavior specified by the Invalid permutation index parameter. The following options are available:
Dialog Box


See Also
Submatrixpermute (MATLAB)