Simulink Reference | ![]() ![]() |
Library
Simulink Math Operations and Fixed-Point Blockset Math
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.
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.
When the Show additional parameters check box is selected, some of the parameters that become visible are common to many blocks. For a detailed description of these parameters, refer to Block Parameters in the Fixed-Point Blockset documentation.
Data Type Support
The Product block accepts signals of any complexity and data type, including fixed-point data types except int64
and uint64
. All input signals must be of the same data type.
Parameters and Dialog Box
*
" and "/
" symbols. See Description above for a complete discussion of this parameter. 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 Production hardware characteristics parameter on the Advanced pane of the Simulation Parameters dialog is set to Unconstrained integer sizes
, Simulink chooses the data type without regard to hardware constraints. If the parameter is set to Microprocessor
, 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 Unconstrained integer sizes
is specified, the output data type is sfix24
. If Microprocessor
is specified and the microprocessor supports 8-bit, 16-bit, and 32-bit words, the output data type is int32
. If none of the word lengths provided by the target microprocessor can accommodate the output range, Simulink displays an error message in the Simulink Diagnostic Viewer.Specify via dialog
is selected for the Output data type mode parameter.Specify via dialog
is selected for the Output data type mode parameter.Specify via dialog
is selected for the Output data type mode parameter.Conversions and Operations
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. Refer to Rules for Arithmetic Operations in the Fixed-Point Blockset documentation for more information about the rules that this block obeys when performing fixed-point operations.
Characteristics
Dimensionalized |
Yes |
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving block |
Scalar Expansion |
Yes |
Zero Crossing |
No |
![]() | Prelook-Up Index Search | Probe | ![]() |