Y = cumprod(X)
Y = cumprod(X)
, where X
is a vector, returns a vector Y
containing the cumulative product of the elements of X
. If X
is a matrix, Y
is a matrix containing the cumulative products over each column.
cumprod(1:5) = [1 2 6 24 120]
prod
(c) Copyright 1994 by The MathWorks, Inc.