| Contents | Index |
Math Operations
The Product of Elements block inputs one scalar, vector, or matrix. You can use the block to:
Copy a scalar input unchanged
Invert a scalar input (divide 1 by it)
Collapse a vector or matrix to a scalar by multiplying together all elements or taking successive inverses of the elements
Collapse a matrix to a vector by multiplying together the elements of each row or column or taking successive inverses of the elements of each row or column
The Product of Elements block is functionally a Product block that has two preset parameter values:
Multiplication: Element-wise(.*)
Number of inputs: *
Setting non-default values for either of those parameters can change a Product of Elements block to be functionally equivalent to a Product block or a Divide block. See the documentation of those two blocks for more information.
The Product of Elements block uses the following algorithms to perform element-wise operations on inputs of floating-point, built-in integer, and fixed-point types:
| Input | Element-Wise Operation | Algorithm |
|---|---|---|
Real scalar, u | Multiplication | y = u |
| Division | y = 1/u | |
Real vector or matrix, with elements u1, u2, u3, ..., uN | Multiplication | y = u1*u2*u3*...*uN |
| Division | y = ((((1/u1)/u2)/u3).../uN) | |
Complex scalar, u | Multiplication | y = u |
| Division | y = 1/u | |
Complex vector or matrix, with elements u1, u2, u3, ..., uN | Multiplication | y = u1*u2*u3*...*uN |
| Division | y = ((((1/u1)/u2)/u3).../uN) |
If the specified dimension for element-wise multiplication or division is a row or column of a matrix, the algorithm applies to that row or column. For example, consider the following model:

The top Product of Elements block collapses the matrix input to a scalar by taking successive inverses of the four elements:
y = ((((1/2+i)/3)/4-i)/5)
The bottom Product of Elements block collapses the matrix input to a vector by taking successive inverses along the second dimension:
y(1) = ((1/2+i)/3)
y(2) = ((1/4-i)/5)
The Product of Elements block has the same parameters and dialog box as the Product block, plus the parameter Multiply over, which has the default value All dimensions:

If you set Multiply over to Specified dimension, the Dimension parameter appears.
To copy, invert, or collapse one input to create an output, you can use the Product of Elements block with default values for all parameters except Number of inputs, Multiply over, and Dimension. These values can require change. For other capabilities, see the Product block documentation, which also describes the Signal Attributes Pane of the Product of Elements block.
This parameter is the same as in the Product block, but the value must be * (the default), 1, or / to achieve the behavior of a Product of Elements block.
| Parameter Value | Block Behavior | Block Icon |
|---|---|---|
| * or 1 |
For more information, see Algorithm. |
|
| / |
For more information, see Algorithm. |
|
This parameter appears only when Multiplication is Element-wise(.*) and Number of inputs is *, 1, or /. The parameter affects only a matrix input. The possible values are:
All dimensions — The block outputs a scalar that is the product of all matrix elements, or the result of taking successive inverses of the elements, depending on the value of Number of inputs.
Specified dimension — The block outputs a vector, in which the composition depends on the value of the Dimension parameter.
This parameter appears only when the Multiply over parameter appears and is set to Specified dimension. The parameter affects only a matrix input, and must be 1 for a scalar or vector input. The possible values are:
1 — Output a vector that contains an element for each column of the input matrix.
2 — Output a vector that contains an element for each row of the input matrix.
Each element of the output vector contains the product of all elements in the corresponding column or row of the input matrix, or the result of taking successive inverses of those elements. The output vector depends on the value of Number of inputs:
* or 1
Multiply the values of the column or row elements.
/
Take successive inverses of the column or row elements. For more information, see Algorithm.
This table shows the output of the Product of Elements block for example inputs using default block parameter values, except as shown in the table.
| Parameter Values | Examples |
|---|---|
Multiplication: Element-wise(.*) Number of inputs: * |
|
Multiplication: Element-wise(.*) Number of inputs: / |
|
Multiplication: Element-wise(.*) Number of inputs: * |
|
Multiplication: Element-wise(.*) Number of inputs: * Multiply over: All dimensions |
|
Multiplication: Element-wise(.*) Number of inputs: * Multiply over: Specified dimension Dimension: 1 |
|
Multiplication: Element-wise(.*) Number of inputs: / Multiply over: Specified dimension Dimension: 2 |
|

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |