cumprod

Purpose

Cumulative product.

Synopsis

Y = cumprod(X)

Description

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.

Examples

cumprod(1:5) = [1  2  6  24  120]

See Also

prod

(c) Copyright 1994 by The MathWorks, Inc.