cumprod
Syntax
cumprod(X)
Please see Cumulative Window Functions for the parameter description and windowing logic.
Details
Cumulatively calculate the product of the elements in X.
Examples
cumprod(2 3 4);
// output
[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: prod