FUNCTION REFERENCE

cumprod

Cumulative product.

Cumulative product.

Syntax

cumprod(A)

Syntax

cumprod(A, dim)

Works along the first non-singleton dimension unless dim is given.

Example

cumprod([1 2 3 4])   % [1 2 6 24]

Differences from MATLAB: Real and complex 2-D arrays; for 2-D input dim 3 or higher returns A unchanged. A complex 2-D result stays complex. N-D arrays (part 2): any dim, 'reverse'/'forward' and 'omitnan'/'includenan'; integer input keeps its class.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.