cumsum4

Syntax

cumsum4(X)

Arguments

X is a scalar, vector or matrix

Details

If X is a vector, calculate the cumulative sum of the fourth powers 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];
$ cumsum4 x;
[16,97,353]

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

#0

#1

1

4

2

5

3

6

$ cumsum4(m);

#0

#1

1

256

17

881

98

2177

Related functions: cumsum, cumsum2, cumsum3