cumsum

Details

Cumulatively calculate the sum of the elements in X.

Examples

x=[2,3,4];
cumsum(x);
// output
[2,5,9]

m=matrix(1 2 3, 4 5 6);
m;
#0 #1
1 4
2 5
3 6
cumsum(m);
#0 #1
1 4
3 9
6 15

Related functions: cumsum2, cumsum3, cumsum4