MatrixReshape
This block produces an output matrix by reshaping its input matrix. The dimensions, not the contents, of the matrix are modified. A block parameter is used to specify the output dimensions.
Library
Activate/MatrixOperations
Description
The MatrixReshape block changes the dimensions (but not the values) of a matrix or a vector as specified by the user in the "output size desired" parameter (as usual in Activate, negative values may be used to specify unknown sizes.)
The input matrix can be either of type Double or type Complex and Column major indexing is assumed for matrices.
The output size (number of elements) must be equal to the input size.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
outsize | Output size | size of the output matrix. For example [1,6]. Use of "-1" for the output size definition is permitted. | Vector of size 2 | |
externalActivation | External activation | Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected. | Number | 0 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | explicit | output | 1 | |
Port 2 | explicit | input | 1 | |
Port 3 | activation | input | externalActivation |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | no | |
direct-feedthrough | yes | |
zero-crossing | no | |
mode | no | |
continuous-time state | no | |
discrete-time state | no |
Example
If input is [1 2 3 4; 5 6 7 8], the MatrixReshape for a desired output of size [1,8] is [1 5 2 6 3 7 4 8].