cumprod
Cumulative product along a dimension.
Syntax
Section titled “Syntax”B = cumprod(A)B = cumprod(A, dim)Description
Section titled “Description”Returns an array of the same size as A where each element is the running product from the start of its row/column up to that position. With no dimension argument, accumulates along the first non-singleton dimension.
Examples
Section titled “Examples”cumprod(1:5) % [1 2 6 24 120] factorialscumprod([1 2; 3 4]) % [1 2; 3 8] column cumulative products