Permute Matrix
Rearranging rows or columns of a matrix.
blockType: PermuteMatrix
Path in the library:
|
Description
Block Permute Matrix generates a new matrix from the columns (rows) of the original matrix by rearranging and/or copying them. The block rearranges the rows or columns of the input matrix size on according to the column (row) numbers received from the input P.
Ports
Input
#
A
—
the input matrix
scalar | vector | the matrix
Details
The original matrix.
| Data types |
|
| Complex numbers support |
Yes |
#
P
—
column (row) numbers to be rearranged
scalar | vector | the matrix
Details
Column (row) numbers of the matrix , from which a new matrix will be formed. Scalar or vector.
| Data types |
|
| Complex numbers support |
Yes |
Output
#
OUT_1
—
the output matrix
scalar | vector | the matrix
Details
The output matrix formed by rearranging the rows or columns of the input. The output data type is the same as the input. The dimension of the original matrix is preserved.
| Data types |
|
| Complex numbers support |
Yes |
Parameters
Main
#
Permute —
the permutation method
Columns | Rows
Details
Specifies whether the columns or rows of the input matrix will be rearranged to get the output matrix.
If the parameter Permute it matters:
-
Rows— the block uses the rows of the input matrix to create a matrix with the same column dimension. The input P is a vector of length , the elements of which determine where each row from the input matrix should be placed in the output matrix on .To rearrange the rows, the block considers an undirected length vector. , arriving at port A, as a matrix on .
-
Columns— the block uses the columns of the input matrix to create a matrix with the same row dimension. A length vector is fed to the input P , the elements of which determine where each column from the input matrix should be placed in the output matrix on .To rearrange the columns, the block considers an undirected length vector. , arriving at port A, as a matrix on .
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Index Mode —
index mode
One-based | Zero-based
Details
When setting the value One-based meaning 1 in the permutation vector refers to the first row or column of the input matrix . During installation Zero-based meaning 0 in refers to the first row or column .
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Invalid permutation index —
reaction to an invalid index value
Clip index | Clip and warn | Generate error
Details
A reaction to an invalid index value. If the index value in the input P refers to a non-existent row or column of the input matrix , the block reacts as specified in this parameter. The following options are possible:
-
Clip index— trim the index to the nearest acceptable value (1or to rearrange the rows and1or to rearrange columns) and not issue a warning.Example: For the input matrix
3on7the column index is equal to9, is cropped to7, and the row index is equal to−2, is cropped to1. -
Clip and warn— the same as the previous option; in future releases, when you select this option, a warning message will be displayed in the Engee command prompt window. -
Generate error— display the error dialog box and abort the simulation.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Error when length of P is not equal to Permute dimension size —
error message for length
Logical
Details
The option to display an error dialog box and stop modeling if the length of the permutation vector is is not equal to the number of rows or columns of the input matrix .
You can choose to open the error dialog box and end the simulation by setting this parameter to on.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |