cumsum3

Syntax

cumsum3(X)

Arguments

X is a vector or matrix

Details

If X is a vector, calculate the cumulative sum of cubes of X and return a vector of the same length as X.

If X is a matrix, conduct the aforementioned calculation within each column of X. The result is a matrix with the same shape as X.

Examples

$ x=[2,3,4];
$ cumsum3 x;
[8,35,99]

$ m=matrix(1 2 3, 4 5 6);
$ m;

#0

#1

1

4

2

5

3

6

$ cumsum3(m);

#0

#1

1

64

9

189

36

405

Related functions: cumsum, cumsum2