cumprod
Cumulative product
Description
returns
the cumulative product of B
= cumprod(A
)A
starting at the beginning
of the first array dimension in A
whose size does
not equal 1.
If
A
is a vector, thencumprod(A)
returns a vector containing the cumulative product of the elements ofA
.If
A
is a matrix, thencumprod(A)
returns a matrix containing the cumulative products for each column ofA
.If
A
is a multidimensional array, thencumprod(A)
acts along the first nonsingleton dimension.
Examples
Input Arguments
Output Arguments
More About
Tips
Many cumulative functions in MATLAB® support the
'reverse'
option. This option allows quick directional calculations without needing a flip or reflection of the input array.
Extended Capabilities
Version History
Introduced before R2006a