David
Farruggio

MathGenie

cumprod

Cumulative product

Syntax and Description

cumprod(A) returns the cumulative product of A starting at the beginning of the first array dimension in A whose size does not equal 1.
  • If A is a vector, then cumprod(A) returns a vector containing the cumulative product of the elements of A.
  • If A is a matrix, then cumprod(A) returns a matrix containing the cumulative products for each column of A.
    cumprod(A,dim) returns the cumulative product along dimension dim. For example, if A is a matrix, then cumprod(A,2) returns the cumulative product of each row.

    Back to functions