This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

dsp.CumulativeProduct System object

Cumulative product of channel, column, or row elements


The CumulativeProduct object computes the cumulative product of channel, column, or row elements.

To compute the cumulative product of channel, column, or row elements:

  1. Define and set up your cumulative product object. See Construction.

  2. Call step to compute the cumulative product according to the properties of dsp.CumulativeProduct. The behavior of step is specific to each object in the toolbox.


Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


cprod = dsp.CumulativeProduct returns a cumulative product object, cprod, that computes the cumulative product of input matrix or input vector elements along the default Dimension.

cprod = dsp.CumulativeProduct('PropertyName',PropertyValue,...) returns a cumulative product object, cprod, with each specified property set to the specified value.



Computation dimension for cumulative product

Specify the computation dimension as one of | Channels (running product) | Rows | Columns |. The default is Channels (running product).


Enable resetting cumulative product via input port

Set this property to true to enable resetting the cumulative product. When you set this property to true, specify a reset signal to the step method to reset the cumulative product. You can access this property when the Dimension property is set to Channels (running product). The default is false.


Reset condition for cumulative product

Specify the event on the reset input port that causes resetting the cumulative product to one of | Rising edge | Falling edge | Either edge | Non-zero |. This property applies when you set the ResetInputPort property to true and the Dimension property to Channels (running product). The default is Rising edge.

 Fixed-Point Properties


resetReset running cumulative product
stepCumulative product of input along specified dimension for input
Common to All System Objects

Create System object with same property values


Expected number of inputs to a System object


Expected number of outputs of a System object


Check locked states of a System object (logical)


Allow System object property value changes


expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Use the dsp.CumulativeProduct object to compute the cumulative product of a matrix.

 cprod = dsp.CumulativeProduct;
 x = magic(2)
x = 

     1     3
     4     2

 y = cprod(x)
y = 

     1     3
     4     6

The cumulative product is computed column-wise along each channel.


This object implements the algorithm, inputs, and outputs described on the Cumulative Product block reference page. The object properties correspond to the block parameters, except:

The Reset port block parameter corresponds to both the ResetCondition and ResetInputPort object properties.

Extended Capabilities

Introduced in R2012a

Was this topic helpful?