cumprod

Syntax

cumprod(X)

Please see Cumulative Window Functions (cum-functions) for the parameters and windowing logic.

Details

Cumulatively calculate the product of the elements in X.

Examples

$ cumprod(2 3 4);
[2,6,24]
// equivalent to  [2, 2*3, 2*3*4]

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

#0

#1

1

4

2

5

3

6

$ cumprod(m);

#0

#1

1

4

2

20

6

120

Related functions: cummax, cummin, cumsum, cumPositiveStreak