| Signal Processing Blockset™ | ![]() |
Math Functions / Matrices and Linear Algebra / Matrix Operations
dspmtrx3
The Array-Vector Subtract block subtracts the values in the input vector V from the values in the specified dimension of the N-dimensional input array A.
The length of the input V must be the same as the length of the specified dimension of A. The Array-Vector Subtract block subtracts each element of V from the corresponding element along that dimension of A.
Consider a 3-dimensional M-by-N-by-P input array A(i,j,k) and a P-by-1 input vector V. When the Subtract along dimension parameter is set to 2, the output of the block Y(i,j,k) is
![]()
where

The output of the Array-Vector Subtract block is the same size as the input array, A. When both inputs are sample based, the output is sample based; otherwise, the output is frame based. This block accepts real and complex floating-point and fixed-point inputs.
The following diagram shows the data types used within the Array-Vector Subtract block for fixed-point signals.

When the vector V is designated in the block mask, its elements have the data type and scaling that you specify in the Vector (V) parameters on the Fixed-point 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 subtractor is in the accumulator data type.
You can set the vector, accumulator, and output data types in the block dialog as discussed below.
The Main pane of the Array-Vector Subtract block dialog appears as follows.

Specify the dimension along which to subtract the elements of vector V from the input array A.
Specify the source of the vector, V. The vector can come from the Input port or from a Dialog parameter.
Specify the vector, V. This parameter is visible only when you select Dialog parameter for the Vector (V) source parameter.
The Fixed-point pane of the Array-Vector Subtract block dialog appears as follows.

Select the rounding mode for fixed-point operations.
Select the overflow mode for fixed-point operations.
Use this parameter to specify how you would like to designate the word and fraction lengths of the elements of the vector, V:
When you select Same word length as input, the word length of the vector values match that of the input to the block.
When you select Specify word length, you can enter the word length of the vector values, in bits. In this mode, the fraction length of the vector values is automatically set to the binary-point only scaling that provides you with the best precision possible given the value and word length of the values.
When you select Binary point scaling, you can enter the word length and the fraction length of the vector elements, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the vector element. This block requires power-of-two slope and a bias of zero.
Note The Vector (V) parameters on the Fixed-point pane are only applicable when you specify the vector through the Vector (V) parameter on the Main pane of the block mask. When the vector comes in through the block port, the data type and scaling of its elements are inherited from the driving block. |
Use this parameter to specify how you would like to designate the accumulator word and fraction lengths. See Fixed-Point Data Types for an illustration depicting the use of the accumulator data type in this block.
When you select Inherit via internal rule, the accumulator word length and fraction length are calculated automatically. For information about how the accumulator word and fraction lengths are calculated when an internal rule is used, see Inherit via Internal Rule.
When you select Same as first input, these characteristics match those of the first input to the block.
When you select Binary point scaling, you can enter the word length and the fraction length of the accumulator, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the accumulator. This block requires power-of-two slope and a bias of zero.
Choose how you specify the output word length and fraction length:
When you select Same as accumulator, these characteristics match those of the accumulator.
When you select Same as first input, these characteristics match those of the first input to the block.
When you select Binary point scaling, you can enter the word length and the fraction length of the output, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the output. This block requires power-of-two slope and a bias of zero.
Select this parameter to prevent any fixed-point scaling you specify in this block mask from being overridden by the autoscaling tool in the Fixed-Point Tool.
| Port | Supported Data Types |
|---|---|
A |
|
V |
|
Output |
|
| Array-Vector Add | Signal Processing Blockset |
| Array-Vector Divide | Signal Processing Blockset |
| Array-Vector Multiply | Signal Processing Blockset |
![]() | Array-Vector Multiply | Autocorrelation | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |