Using Simulink | ![]() ![]() |
Generate the element-wise product, quotient, matrix product, or inverse of block inputs.
Library
Description
The Product block outputs the element-wise or matrix product of its inputs, depending on the values of the Multiplication and Number of inputs parameters:
*
and / symbols, the number of block inputs is equal to the number of symbols. The block icon shows the appropriate symbol adjacent to each input port. For example, entering */
as the parameter value results in the block icon
when the the Multiplication parameter is element-wise
.
If the value of the Multiplication parameter is element-wise
, the block output is the element-by-element product of all inputs marked *
divided by all inputs marked /. For example, if the inputs are vectors of size n
, the output is a vector of size n
each of whose elements equals
(To create the dot-product of input vectors, use the Dot Product block.
If any input is a matrix, all inputs must be a matrix or a scalar where a scalar is defined as a 1-by-1 matrix or a 1-element vector. If any input is a vector, all inputs must be vector-like. A vector-like input is any input that is either a scalar, a vector, or a column matrix or a row matrix. All nonscalar inputs must have the same dimension. The inputs cannot include both column and row matrices.
If the value of the Multiplication parameter is matrix
, the block output is the matrix product of inputs marked *
multiplied by the matrix inverse of each input marked /. The order of operations is the same as the order specified by the Number of Inputs field, for example, a value of */*
results in the matrix product AB-1C, where A, B, C are the first, second, and third inputs signals, respectively. The dimensions of the matrices must be such that the matrix product is defined.
If all inputs are scalars, the output of the block is a scalar. Otherwise, the output is a matrix or a vector depending on whether the inputs are matrices or vectors.
*
, the value of the Multiplication parameter is element-wise
, and the input is vector-like, i.e., a 1-D array or a one-column or one-row 2-D array, the block outputs the scalar product of the elements of the input.In this case, the block icon appears as follows.
If the input is a matrix and the the Multiplication parameter is element-wise
, Simulink signals an error. If the value of the Multiplication parameter is matrix,
the block outputs the input unchanged.
/
, the value of the Multiplication parameter is element-wise
, and the input is vector-like, the block outputs the inverse of the scalar product of the input elements. If the input is a matrix and the the Multiplication parameter is element-wise
, Simulink signals an error. If the value of the Multiplication parameter is matrix
, the block outputs the matrix inverse of the input.*
characters where the length of the string is the scalar value. If necessary, Simulink resizes the block to show all input ports. If the number of inputs is changed, ports are added or deleted from the bottom of the block.
Data Type Support
The Product block accepts real- or complex-valued signals of any data type for element-wise multiplication. All input signals must be of the same data type. The output signal data type is the same as the input's. The inputs must be real or complex signals of type single
or double
for matrix multiplication.
Parameters and Dialog Box
*
and / symbols. The default is 2
.Characteristics
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving block |
Scalar Expansion |
Yes |
Dimensionalized |
Yes |
Zero Crossing |
No |
![]() | Prelook-Up Index Search | Probe | ![]() |