dsp.ArrayVectorAdder System object

Package: dsp

Add array to vector along specified dimension

Description

The ArrayVectorAdder object adds an N-D array to a vector along a specified dimension. The length of the vector must equal the size of the N-D array along the specified dimension.

To add an N-D array to a vector along a specified dimension:

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

  2. Call step to add the N-D array according to the properties of dsp.ArrayVectorAdder. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.ArrayVectorAdder returns an array-vector addition object, H, that adds a vector to an N-D array along the first dimension.

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

Properties

Dimension

Dimension along which to add vector elements to input

Specify the dimension along which to add the input array to the elements of the vector as a positive integer. The length of the vector must match the size of the N-D array along the specified dimension. The default is 1.

VectorSource

Source of vector

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

Vector

Vector values

Specify the vector values. This property applies only 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 adder object 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
stepAdd vector to N-D array

Examples

Add 2-by-1 vector to 2-by-2 matrix along the first dimension of the array.

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

Algorithms

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

The array-vector addition object does not have Minimum or Maximum options for data output.
Was this topic helpful?