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.

    SumElements

Library

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

SumElements_0

NameLabelDescriptionData TypeValid Values

decomptyp

Sum along

String

'All'
'Rows'
'Columns'

overflow

Do on overflow

String

'Nothing'
'Saturate'
'Error'

externalActivation

External activation

Number

0
1

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

input

1

Port 2

explicit

output

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