Scilab Function

cumsum - cumulative sum

Calling Sequence

y=cumsum(x)
y=cumsum(x,'r') or y=cumsum(x,1)
y=cumsum(x,'c') or y=cumsum(x,2)

Parameters

Description

For a vector or a matrix x, y=cumsum(x) returns in y the cumulative sum of all the entries of x taken columnwise.

y=cumsum(x,'c') (or, equivalently, y=cumsum(x,2)) returns in y the cumulative sum of the columns of x: y(i,:)=cumsum(x(i,:))

y=cumsum(x,'r') (or, equivalently, y=cumsum(x,1)) returns in y the cumulative sum of the rows of x: y(:,i)=cumsum(x(:,i))

Examples

See Also