Array-Vector Multiply - Multiply array by vector along specified dimension - Simulink (original) (raw)

Multiply array by vector along specified dimension

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

Description

The Array-Vector Multiply block multiplies the values in the specified dimension of the _N_-dimensional input array A by the values in the input vector V.

The length of the input V must be the same as the length of the specified dimension of A. The Array-Vector Multiply block multiplies each element of V by the corresponding element along that dimension of A.

Consider a 3-dimensional_M_-by-N_-by-P input array_A(i,j,k) and an N_-by-1 input vector_V. When the Multiply along dimension parameter is set to 2, the output of the block Y(i,j,k) is

where

The output of the Array-Vector Multiply block is the same size as the input array A. This block accepts real and complex floating-point and fixed-point inputs.

Ports

Input

expand all

Specify the array input as a vector or a matrix.

If the input is fixed point, it must be a signed integer or a signed fixed point value with a power-of-two slope and zero bias.

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

Specify the vector input as a vector.

Dependencies

This port appears only when you set the Vector (V) source parameter to Input port.

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

Output

expand all

Output of the Array-Vector Multiply block, returned as a vector or a matrix.

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

Parameters

expand all

Main Tab

Specify the dimension along which to multiply the input array A by the elements of vector V as a positive integer.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Set the source of the vector V to one of these options.

Specify the vector V.

Dependencies

This parameter appears only when you set the Vector (V) source parameter to Dialog parameter.

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

Data Types Tab

Note

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

Set the rounding mode for fixed-point operations to one of these options.

For details, see rounding mode.

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

Use this parameter to specify the word and fraction lengths for the elements of the vector, V. Select this parameter as one of these options.

Alternatively, you can set the Vector (V) data type by using the Data Type Assistant. To use the assistant, click theShow data type assistant button .

For more information on the data type assistant, see Specify Data Types Using Data Type Assistant (Simulink).

Note

When the vector comes in through the input port of the block, the data type and scaling of its elements are inherited from the driving block.

Dependencies

This parameter appears only when you set the Vector (V) source parameter on the tab toDialog parameter.

Specify the minimum value for the elements of vector V. The default value is [] (unspecified). Simulink® uses this value to perform:

Dependencies

This parameter appears only when you set the Vector (V) source parameter on the tab toDialog parameter.

Specify the maximum value for the element of vector V. The default value is [] (unspecified). Simulink uses this value to perform:

Dependencies

This parameter appears only when you set the Vector (V) source parameter on the tab toDialog parameter.

Specify the data type of the output of a product operation in theArray-Vector Multiply block. For illustrations depicting the use of the product output data type in this block, see Fixed-Point Data Types and Multiplication Data Types. Set this parameter to one of these options.

Alternatively, you can set the Product output data type by using the Data Type Assistant. To use the assistant, click theShow data type assistant button .

For more information on the data type assistant, see Specify Data Types Using Data Type Assistant (Simulink).

Specify the data type of the output of an accumulation operation in theArray-Vector Multiply block. For illustrations depicting the use of the accumulator data type in this block, see Fixed-Point Data Types. Set this parameter to one of these options.

Alternatively, you can set the Accumulator data type by using the Data Type Assistant. To use the assistant, click theShow data type assistant button .

For more information on the data type assistant, see Specify Data Types Using Data Type Assistant (Simulink).

Specify the output data type. For illustrations depicting the use of the output data type in this block, see Fixed-Point Data Types. Set this parameter to one of these options.

For more information, see Control Data Types of Signals (Simulink).

Alternatively, you can set the Output data type by using theData Type Assistant. To use the assistant, click theShow data type assistant button .

For more information on the data type assistant, see Specify Data Types Using Data Type Assistant (Simulink).

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

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

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

The following diagram shows the data types used within the Array-Vector Multiply block for fixed-point signals.

When you specify the vector V on the tab of the block mask, you must specify the data type and scaling properties of its elements in the Vector (V) parameter on the tab. When the vector comes in through the block port, its elements inherit their data type and scaling from the driving block.

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 vector, accumulator, product output, and output data types in the block dialog.

Extended Capabilities

Version History

Introduced in R2007b