cumsum2

Details

Cumulatively calculate the sum of squares of the elements in X.

Examples

x=[2,3,4];
cumsum2 x;
// output
[4,13,29]

m=matrix(1 2 3, 4 5 6);
m;
#0 #1
1 16
5 41
14 77

Related function: cumsum, cumsum3, cumsum4