Documentation Center

  • Trial Software
  • Product Updates

dsp.ArrayVectorSubtractor System object

Package: dsp

Subtract vector from array along specified dimension

Description

The ArrayVectorSubtractor object subtracts a vector from an N-D array along a specified dimension.

To subtract a vector from an N-D array along a specified dimension:

  1. Define and set up your array-vector subtraction object. See Construction.

  2. Call step to subtract the vector according to the properties of dsp.ArrayVectorSubtractor. The behavior of step is specified to each object in the toolbox.

Construction

H = dsp.ArrayVectorSubtractor returns an array-vector subtraction object, H, that subtracts the elements of a vector from an N-D input array along the first dimension.

H = dsp.ArrayVectorSubtractor('PropertyName',PropertyValue,...) returns an array-vector subtraction object, H, with each property set to the specified value.

Properties

Dimension

Dimension along which to subtract vector elements from input

Specify the dimension along which to subtract the elements of the vector from the input array as an integer-valued scalar greater than 0. The default is 1.

VectorSource

Source of vector

Specify the source of the vector values as one of Input port or Property. The default is Input port.

Vector

Vector values

Specify the vector values. This property applies when you set the VectorSource property to Property. The default is [0.5 0.25]. This property is tunable.

 Fixed-Point Properties

Methods

cloneCreate array-vector subtractor with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepSubtract vector from array along specified dimension

Examples

Subtract a vector from a matrix:

 havs = dsp.ArrayVectorSubtractor;
 a = ones(2);
 x = [1 2]';
 y = step(havs, a, x); 

Algorithms

This object implements the algorithm, inputs, and outputs described on the Array-Vector Subtract block reference page. The object properties correspond to the block parameters, except:

The array-vector subtraction object does not have Minimum or Maximum options for data output.

See Also

| |

Was this topic helpful?