| Simulink® | ![]() |
Math Operations

The Product block performs multiplication or division of its inputs.
This block produces outputs using either element-wise or matrix multiplication, depending on the value of the Multiplication parameter. You specify the operations with the Number of inputs parameter. The Product block first performs the specified multiply or divide operations on the inputs, and then converts the results to the output data type using the specified rounding and overflow modes.
The Product block accepts real or complex signals of any data type supported by Simulink® software including fixed-point data types.
Note The Product block does not support division for complex signals with boolean or fixed-point data types. Otherwise, the block accepts complex signals for inputs marked "/" only when the input and output signals all specify the same built-in data type. In this case, however, the block ignores its specified rounding mode. |
For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink® in the Simulink documentation.
The Main pane of the Product dialog appears as follows:

Enter the number of inputs or a combination of "*" and "/" symbols. Multiply (*) and divide (/) characters indicate the operations to be performed on the inputs:
If there are two or more inputs, then the number of characters must equal the number of inputs. For example, "*/*" requires three inputs. For this example, if the Multiplication parameter is set to Element-wise(.*), the block divides the elements of the first input by the elements of the second input, and then multiplies by the elements of the third input. (See Changing the Orientation of a Block in Using Simulink® for a description of the port order for various block orientations.) In this case, all nonscalar inputs to this block must have the same dimensions.
Note The Product block internally reorders its first two inputs, u1 and u2, if all of the following conditions apply:
In this case, the block computes the simplified expression u2 / u1 instead of the default computation (1 / u1) * u2 The reordered computation provides more accurate results and is more efficient. |
If, however, the Multiplication parameter is set to Matrix(*), the block output is the matrix product of the inputs marked "*" and the inverse of inputs marked "/", with the order of operations following the entry in the Number of inputs parameter. The dimensions of the inputs must be such that the matrix product is defined.
Note To perform a dot product on input vectors, use the Dot Product block. |
If only multiplication of inputs is required, then a numeric parameter value equal to the number of inputs can be supplied instead of "*" characters. This may be used with either element-wise or matrix multiplication.
If there is only one input port and the Multiplication parameter is set to Element-wise(.*), a single "*" or "/" collapses the input signal using the specified operation. However, if the Multiplication parameter is set to Matrix(*), a single "*" causes the block to output the matrix unchanged, and a single "/" causes the block to output the matrix inverse.
Specify element-wise or matrix multiplication.
Note This block supports multidimensional signals only for element-wise multiplication. |
Specify the collapse mode. Select All dimensions or Specified dimension.
Specify the dimension over which the operation is to be performed. This parameter appears only if you select Specified dimension for the Multiply over parameter.
Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See Specifying Sample Time in the online documentation for more information.
The Signal Attributes pane of the Product dialog appears as follows:

Select this parameter to require that all inputs have the same data type.
Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Specify the output data type. You can set it to:
A rule that inherits a data type, for example, Inherit: Inherit via back propagation
The name of a built-in data type, for example, single
The name of a data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, float('single')
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Output
data type parameter.
See Specifying Block Output Data Types for more information.
If you select Inherit: Inherit via internal rule for this parameter, Simulink software chooses a combination of output scaling and data type that requires the smallest amount of memory consistent with accommodating the output range and maintaining the output precision (and avoiding underflow in the case of division operations). If the Device type parameter on the Hardware Implementation pane of the Configuration Parameters dialog is set to Custom, Simulink software chooses the data type without regard to hardware constraints. Otherwise, Simulink software chooses the smallest available hardware data type capable of meeting range, precision, and underflow constraints. For example, if the block multiplies inputs of type int8 and int16 and Custom is specified as the device type, the output data type is sfix24. If Unspecified (assume 32-bit generic) is specified, the output data type is int32. If none of the word lengths provided by the target hardware can accommodate the output range, Simulink software displays an error message in the Simulation Diagnostics Viewer.
Select to lock scaling of outputs. This parameter is visible only if you enter an expression for the Output data type parameter.
Select the rounding mode for fixed-point operations. For more information, see Rounding in the Simulink® Fixed Point™ User's Guide.
Select to have overflows saturate.
Direct Feedthrough | Yes |
Sample Time | Specified in the Sample time parameter |
Scalar Expansion | Yes |
Dimensionalized | Yes |
Multidimensionalized | Yes, only when the Multiplication parameter specifies Element-wise(.*) |
Zero Crossing | No |
![]() | Prelookup | Product of Elements | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |