Array-Vector Multiply
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
A — Array input
vector | matrix
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
V — Vector input
vector
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
Port_1 — Multiplied output
vector | matrix
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
Main Tab
Multiply along dimension — Dimension along which to multiply input array
2
(default) | positive integer
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
Vector (V) source — Source of vector
Input port
(default) | Dialog parameter
Set the source of the vector V to one of these options.
Input port
— Vector comes from the input port.Dialog parameter
— Vector comes from the dialog parameter Vector (V).
Vector (V) — Vector parameter
[0.5 0.25]
(default) | vector
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 Data Types tab. When inputs are floating point, the block ignores these settings and all internal data types are floating point.
Rounding mode — Method of rounding operation
Floor
(default) | Ceiling
| Convergent
| Nearest
| Round
| Simplest
| Zero
Set the rounding mode for fixed-point operations to one of these options.
Ceiling
Convergent
Floor
Nearest
Round
Simplest
Zero
For details, see rounding mode.
Saturate on integer overflow — Method of overflow action
off
(default) | on
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
and
wrap
, see overflow mode for
fixed-point operations.
Vector (V) — Word and fraction lengths for elements of vector
Inherit: Same word length as
input
(default) | fixdt(1,16,0)
| <data type expression>
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.
Inherit: Same word length as input
— Inherits the data type so it is the same as that of the input array A.fixdt(1,16,0)
— Specifies a signed, binary-point, scaled, fixed-point data type with a word length of 16 bits and a fraction length of 0.<data type expression>
— Lets you specify an expression that evaluates to a valid data type.
Alternatively, you can set the Vector (V) data type by using the Data Type Assistant. To use the assistant, click the Show 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 Main tab to
Dialog parameter
.
Vector (V) Minimum — Minimum value for elements of vector
[]
(unspecified) (default) | scalar
Specify the minimum value for the elements of vector V. The
default value is []
(unspecified). Simulink® uses this value to perform:
Parameter range checking. For more information, see Specify Minimum and Maximum Values for Block Parameters (Simulink).
Automatic scaling of fixed-point data types.
Dependencies
This parameter appears only when you set the Vector (V)
source parameter on the Main tab to
Dialog parameter
.
Vector (V) Maximum — Maximum value for elements of vector
[]
(unspecified) (default) | scalar
Specify the maximum value for the element of vector V. The
default value is []
(unspecified). Simulink uses this value to perform:
Parameter range checking. For more information, see Specify Minimum and Maximum Values for Block Parameters (Simulink).
Automatic scaling of fixed-point data types.
Dependencies
This parameter appears only when you set the Vector (V)
source parameter on the Main tab to
Dialog parameter
.
Product output — Product output data type
Inherit: Inherit via internal
rule
(default) | Inherit: Same as first input
| fixdt([],16,0)
| <data type expression>
Specify the data type of the output of a product operation in the Array-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.
Inherit: Inherit via internal rule
— Inherits the data type based on an internal rule. For more information on this rule, see Inherit via Internal Rule.Inherit: Same as first input
— Inherits the data type so it is the same as that of the input array A.fixdt([],16,0)
— Lets you specify the fixed-point attributes of the data type.<data type expression>
— Lets you specify an expression that evaluates to a valid data type.
Alternatively, you can set the Product output data type by using the Data Type Assistant. To use the assistant, click the Show data type assistant button .
For more information on the data type assistant, see Specify Data Types Using Data Type Assistant (Simulink).
Accumulator — Accumulator data type
Inherit: Inherit via internal
rule
(default) | Inherit: Same as first input
| Inherit: Same as product output
| fixdt([],16,0)
| <data type expression>
Specify the data type of the output of an accumulation operation in the Array-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.
Inherit: Inherit via internal rule
— Inherits the data type based on an internal rule. For more information on this rule, see Inherit via Internal Rule.Inherit: Same as first input
— Inherits the data type so it is the same as that of the input array A.Inherit: Same as product output
— Inherits the data type so it is the same as the product output data type.fixdt([],16,0)
— Lets you specify the fixed-point attributes of the data type.<data type expression>
— Lets you specify an expression that evaluates to a valid data type.
Alternatively, you can set the Accumulator data type by using the Data Type Assistant. To use the assistant, click the Show data type assistant button .
For more information on the data type assistant, see Specify Data Types Using Data Type Assistant (Simulink).
Output — Output data type
Inherit: Same as product output
(default) | Inherit: Same as first input
| Inherit: Same as first input
| fixdt([],16,0)
| <data type expression>
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.
Inherit: Same as first input
— Inherits the data type so it is the same as that of the input array A.Inherit: Same as product output
— Inherits the data type so it is the same as the product output data type.fixdt([],16,0)
— Lets you specify the fixed-point attributes of the data type.<data type expression>
— Lets you specify an expression that evaluates to a valid data type.
For more information, see Control Data Types of Signals (Simulink).
Alternatively, you can set the Output data type by using the Data Type Assistant. To use the assistant, click the Show data type assistant button .
For more information on the data type assistant, see Specify Data Types Using Data Type Assistant (Simulink).
Output Minimum — Minimum value of block output
[]
(unspecified) (default) | scalar
Specify the minimum value that the block outputs. The default value is
[]
(unspecified). Simulink uses this value to perform:
Simulation range checking. For more information, see Specify Signal Ranges (Simulink).
Automatic scaling of fixed-point data types.
Output Maximum — Maximum value of block output
[]
(unspecified) (default) | scalar
Specify the maximum value that the block should output. The default value is
[]
(unspecified). Simulink uses this value to perform:
Simulation range checking. For more information, see Specify Signal Ranges (Simulink).
Automatic scaling of fixed-point data types.
Lock data type settings against changes by the fixed-point tools — Prevent fixed-point tools from overriding data types
off
(default) | on
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 |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
More About
Fixed-Point Data Types
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 Main tab of the block mask, you must specify the data type and scaling properties of its elements in the Vector (V) parameter on the Data Types 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
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced in R2007b
See Also
Array-Vector Add | Array-Vector Divide | Array-Vector Subtract
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)