SumElements
This blocks computes the sum of the element of an input matrix/vector. Based on the Sum Along parameter, the output is either a scalar, a row vector or a column vector.
Library
Activate/MatrixOperations
Description
The SumElements block returns the sum of the element of an input matrix/vector.
The input matrix can be either of type Double or type Complex.
When the Sum along parameter is set to all, the block outputs the sum of all the elements of the matrix. The output is then a scalar.
When the Sum along parameter is set to Rows the block performs a row-wise sum. The output is a column vector.
When the Sum along is set to Columns, the block is a column-wise sum. The output is a row vector.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
decomptyp | Sum along | Dimension in which the sum will be computed. Default: all (sum of all the elements of the matrix). | String | 'All' |
overflow | Do on overflow | Flag indicating that no specific action is be taken if an integer overflow occurs. Default: 'nothing' | String | 'Nothing' |
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 | input | 1 | |
Port 2 | explicit | output | 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 |