Matrix_pal Matrix operation palette EXTRACT

Manuel Scilab >> xcos > palettes > Matrix operation palette > CUMSUM

CUMSUM

Cumulative Sum

Block Screenshot

Contents

Palette

Description

The CUMSUM block sums the element of an input m*n matrix u along either the rows, the columns or the first non singleton dimension. When the "Sum along" parameter is set to "1", the block sums across the elements of each row. The result will be displayed as a m*1 matrix.

When the "Sum along" parameter is set to "2", the block sums across the elements of each column. The result will be display as a 1*n matrix.

When the "Sum along" parameter is set to "0", the block sums across the first non singleton dimension. The result will be displayed as one element. This block is equivalent to cumsum in scilab.

Dialog box

Example

A=[1 2 3;4 5 6;7 8 9]
If the sum is along the row the result will be
B=[12;15;18]

Default properties

Interfacing function

Computational function

See also

Authors

Fady NASSIF - INRIA

Matrix_pal Matrix operation palette EXTRACT