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.

    MatrixReshape

Library

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

MatrixReshape_0

NameLabelDescriptionData TypeValid 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
1

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

1

Port 2

explicit

input

1

Port 3

activation

input

externalActivation

Advanced Properties

NameValueDescription

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].

See Also