cumprod
cumprod(X) returns the cumulative product of vector X.
If X is a matrix, the cumulative product is calculated row by row.
cumprod(X, dim) returns the cumulative product of X along dimension dim.
If X is a matrix, the cumulative product is calculated row by row.
cumprod(X, dim) returns the cumulative product of X along dimension dim.
Examples
> cumprod(1:4)#
1 2 6 24
> cumprod([1 2 2; 2 4 3; 2 2 2])#
1 2 2
2 8 6
4 16 12
> cumprod([1 2 2; 2 4 3])#
1 2 2
2 8 6
> cumprod([1 2 2; 2 4 3],2)#
1 2 4
2 8 24