Matrix Product

Multiply matrix elements along rows, columns, or entire input

Library

Math Functions / Matrices and Linear Algebra / Matrix Operations

dspmtrx3

Description

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

When the Multiply over parameter is set to Rows, the block multiplies across the elements of each row and outputs the resulting M-by-1 matrix. A length-N 1-D vector input is treated as a 1-by-N matrix.

When the Multiply over parameter is set to Columns, the block multiplies down the elements of each column and outputs the resulting 1-by-N matrix. A length-M 1-D vector input is treated as a M-by-1 matrix.

When the Multiply over parameter is set to Entire input, the block multiplies all the elements of the input together and outputs the resulting scalar.

The output of the Matrix Product block has the same frame status as the input. This block accepts real and complex fixed-point and floating-point inputs except for complex unsigned fixed-point inputs.

Fixed-Point Data Types

The following diagram shows the data types used within the Matrix Product block for fixed-point signals.

The output of the multiplier is in the product output data type when at least one of the inputs to the multiplier is real. When both of the inputs to the multiplier are complex, the result of the multiplication is in the accumulator data type. For details on the complex multiplication performed, see Multiplication Data Types. You can set the accumulator, product output, intermediate product, and output data types in the block dialog as discussed in Dialog Box below.

Dialog Box

The Main pane of the Matrix Product block dialog appears as follows.

Multiply over

Indicate whether to multiply together the elements of each row, each column, or the entire input.

The Fixed-point pane of the Matrix Product block dialog appears as follows.

Rounding mode

Select the rounding mode for fixed-point operations.

Overflow mode

Select the overflow mode for fixed-point operations.

Intermediate product

As shown in Fixed-Point Data Types, the output of the multiplier is cast to the intermediate product data type before the next element of the input is multiplied into it. Use this parameter to specify how you would like to designate the intermediate product word and fraction lengths:

Product output

Use this parameter to specify how you would like to designate the product output word and fraction lengths. See Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the product output data type in this block:

Accumulator

Use this parameter to specify how you would like to designate the accumulator word and fraction lengths. See Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the accumulator data type in this block. Note that the accumulator data type is only used when both inputs to the multiplier are complex:

Output

Choose how you specify the word length and fraction length of the output of the block:

Lock scaling against changes by the autoscaling tool

Select this parameter to prevent any fixed-point scaling you specify in this block mask from being overridden by the autoscaling feature of the Fixed-Point Tool. See the fxptdlg reference page for more information.

Supported Data Types

Port

Supported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

See Also

Array-Vector MultiplySignal Processing Blockset
Matrix SquareSignal Processing Blockset
Matrix SumSignal Processing Blockset
prodMATLAB

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS