User`s guide
Matrix Sum
5-290
5Matrix Sum
Purpose Sum the elements of a matrix along rows or columns.
Library Math Functions / Matrices and Linear Algebra / Matrix Operations
Description The Matrix Sum block sums the elements of an M-by-N input matrix u along
either the rows or columns.
When the
Sum along parameter is set to Rows, the block sums across the
elements of each row and outputs the resulting M-by-1 matrix. A length-N
1-D vector input is treated as a 1-by-N matrix.
This is equivalent to
y = sum(u,2) % Equivalent MATLAB code
When the Sum along parameter is set to Columns, the block sums down the
elements of each column and outputs the resulting 1-by-N matrix. A length-M
1-D vector input is treated as a M-by-1 matrix.
This is equivalent to
y = sum(u) % Equivalent MATLAB code
The output has the same frame status as the input.
u
11
u
12
u
13
u
21
u
22
u
23
u
31
u
32
u
33
y
1
y
2
y
3
u
11
u
12
u
13
++
u
21
u
22
u
23
++
u
31
u
32
u
33
++
=
u
11
u
12
u
13
u
21
u
22
u
23
u
31
u
32
u
33
y
1
y
2
y
3
u
i1
i 1=
3
∑
u
i2
i 1=
3
∑
u
i3
i 1=
3
∑
=