Main Content

Matrix Product

Multiply matrix elements along rows, columns, or entire input

  • Matrix Product block

Libraries:
DSP System Toolbox / Math Functions / Matrices and Linear Algebra / Matrix Operations

Description

The Matrix Product block multiplies the elements of an M-by-N input matrix along its rows, columns, or over all its elements.

Ports

Input

expand all

Specify the input as a vector or a matrix of size M-by-N.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fixed point
Complex Number Support: Yes

Output

expand all

Output of the Matrix Product block, returned as a vector or a matrix. For more information on how the block computes the output, see the description for the Multiply over parameter.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fixed point
Complex Number Support: Yes

Parameters

expand all

Main Tab

Specify the dimension over which to multiply as one of these:

  • Columns –– The block multiplies down the elements of each column and outputs the resulting 1-by-N matrix. The block treats a length-M unoriented vector input as an M-by-1 matrix.

    [u11u12u13u21u22u23u31u32u33][y1y2y3]=[(i=13ui1)(i=13ui2)(i=13ui3)]

  • Rows –– The block multiplies across the elements of each row and outputs the resulting M-by-1 matrix. The block treats a length-N unoriented vector input as a 1-by-N matrix.

    [u11u12u13u21u22u23u31u32u33][y1y2y3]=[(j=13u1j)(j=13u2j)(j=13u3j)]

  • Entire input –– The block multiplies all the elements of the input together and outputs the resulting scalar.

    [u11u12u13u21u22u23u31u32u33]y=(i=13j=13uij)

Data Types Tab

Note

Floating-point inheritance takes precedence over the data type settings defined on this pane. When inputs are floating point, the block ignores these settings, and all internal data types are floating point.

Specify the rounding mode for fixed-point operations as one of the following:

  • Floor

  • Ceiling

  • Convergent

  • Nearest

  • Round

  • Simplest

  • Zero

For more details, see Rounding Modes.

When you select this parameter, the block saturates the result of its fixed-point operation. When you clear this parameter, the block wraps the result of its fixed-point operation. For details on saturate and wrap, see overflow mode for fixed-point operations.

Specify the intermediate product data type. As shown in Fixed-Point Data Types, the block casts the output of the multiplier to the intermediate product data type before multiplying the next element of the input into it. You can set this parameter to:

  • A rule that inherits a data type, for example, Inherit: Same as input

  • An expression that evaluates to a valid data type, for example, fixdt([],16,0)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Product output parameter.

See Specify Data Types Using Data Type Assistant (Simulink) for more information.

Specify the product output data type. See Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the product output data type in this block. You can set this parameter to:

  • A rule that inherits a data type, for example, Inherit: Inherit via internal rule. For more information on this rule, see Inherit via Internal Rule.

  • A rule that inherits a data type, for example, Inherit: Same as input.

  • An expression that evaluates to a valid data type, for example, fixdt([],16,0)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Product output parameter.

See Specify Data Types Using Data Type Assistant (Simulink) for more information.

Specify the accumulator data type. See Fixed-Point Data Types for illustrations depicting the use of the accumulator data type in this block. You can set this parameter to:

  • A rule that inherits a data type, for example, Inherit: Inherit via internal rule. For more information on this rule, see Inherit via Internal Rule.

  • A rule that inherits a data type, for example, Inherit: Same as input.

  • A rule that inherits a data type, for example, Inherit: Same as product output.

  • An expression that evaluates to a valid data type, for example, fixdt([],16,0)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Accumulator parameter.

See Specify Data Types Using Data Type Assistant (Simulink) for more information.

Specify the output data type. See Fixed-Point Data Types for illustrations depicting the use of the output data type in this block. You can set this parameter to:

  • A rule that inherits a data type, for example, Inherit: Same as product output

  • A rule that inherits a data type, for example, Inherit: Same as input.

  • An expression that evaluates to a valid data type, for example, fixdt([],16,0)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output parameter.

See Control Data Types of Signals (Simulink) for more information.

Specify the minimum value that the block should output. The default value is [] (unspecified). Simulink® uses this value to perform:

  • Simulation range checking (see Specify Signal Ranges (Simulink))

  • Automatic scaling of fixed-point data types

Specify the maximum value that the block should output. The default value is [] (unspecified). Simulink uses this value to perform:

  • Simulation range checking (see Specify Signal Ranges (Simulink))

  • Automatic scaling of fixed-point data types

Select this parameter to prevent the fixed-point tools from overriding the data types you specify in the block dialog box.

Block Characteristics

Data Types

double | fixed point | integer | single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

yes

Zero-Crossing Detection

no

More About

expand all

Extended Capabilities

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a

See Also

Functions

Blocks