Main Content

Permute Matrix by Row or Column

This example shows how to use the Permute Matrix block to permute blocks by row or column.

In the model, the top Permute Matrix block places the second row of the input matrix in the first and fifth rows of the output matrix. The block places the third row of the input matrix in the three middle rows of the output matrix. The bottom Permute Matrix block places the second column of the input matrix in the first and fifth columns of the output matrix. It places the third column of the input matrix in the three middle columns of the output matrix.

Rows and columns of A can appear any number of times in the output, or not at all depending on the index vector.

See Also

Blocks