| Simulink Reference | ![]() |
Library
Description
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. Multiply(*) and divide(/) characters indicate the operations to be performed on the inputs:
*/*" requires three inputs. For this example, if the Multiplication parameter is set to Element-wise, the block divides the elements of the first (top) input by the elements of the second (middle) input, and then multiplies by the elements of the third (bottom) input. In this case, all nonscalar inputs to this block must have the same dimensions.
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. |
*" characters. This may be used in conjunction with either element-wise or matrix multiplication.
Element-wise, then a single "*" will cause the block to output the scalar product of the vector elements. A single "/" will cause the block to output the inverse of the scalar product of the vector elements.
Element-wise, then a single "*" or "/" will cause the block to error out. If, however, the Multiplication parameter is set to Matrix, then a single "*" will cause the block to output the matrix unchanged, and a single "/" will cause the block to output the inverse of the matrix.
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.
Data Type Support
The Product block accepts real or complex signals of any data type supported by Simulink, except Boolean. The Product block supports fixed-point data types.
For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.
Parameters and Dialog Box
The Main pane of the Product dialog appears as follows:
*" and "/" symbols. See Description above for a complete discussion of this parameter.
-1. See Specifying Sample Time in the online documentation for more information.
The Signal data types pane of the Product dialog appears as follows:
Specify via dialog, the Output data type, Output scaling value, and Lock output scaling against changes by the autoscaling tool parameters become visible.
Inherit via internal rule for this parameter, Simulink 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 chooses the data type without regard to hardware constraints. Otherwise, Simulink 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 displays an error message in the Simulation Diagnostics Viewer.
Specify via dialog for the Output data type mode parameter.
Specify via dialog for the Output data type mode parameter.
Specify via dialog for the Output data type mode parameter.
Characteristics
| Direct Feedthrough |
Yes |
| Sample Time |
Specified in the Sample time parameter |
| Scalar Expansion |
Yes |
| Dimensionalized |
Yes |
| Zero Crossing |
No |
| Prelookup Index Search | Product of Elements | ![]() |
© 1994-2005 The MathWorks, Inc.