Main Content

Array-Vector Divide

Divide array by vector along specified dimension

  • Array-Vector Divide block

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

Description

The Array-Vector Divide block divides the values in the specified dimension of the N-dimensional input array A by the values in the input vector V. The Array-Vector Divide block divides each element of V by the corresponding element along that dimension of A.

For more information on how the block computes the output, see Algorithms.

Ports

Input

expand all

Specify the input array as a scalar, vector, matrix, or an N-D array.

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 | fixed point
Complex Number Support: Yes

Specify the vector V to divide as a vector of length equal to the length of the specified dimension in input A.

Dependencies

To enable this parameter, set the Vector (V) source parameter to Input port.

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

Output

expand all

The output of the Array-Vector Divide block, returned as a scalar, vector, matrix, or an N-D array. The output always has the same size, data type, and complexity as the input signal.

For more information on how the block computes the output, see Algorithms.

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

Parameters

expand all

Main Tab

Specify the dimension along which to divide the input array A by the elements of vector V as a positive integer. The value of this parameter must be less than or equal to the number of dimensions of input A.

Specify the source of the vector V as one of these:

  • Input port –– Use the input port V to specify the vector.

  • Dialog parameter –– Use the Vector (V) dialog parameter to specify the vector.

Specify the vector V to divide as a vector of length equal to the length of the specified dimension in input A.

Dependencies

This parameter is visible only when you select Dialog parameter for the Vector (V) source parameter.

Data Types Tab

Note

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

Specify the rounding mode for fixed-point operations as one of the following:

  • Floor

  • Ceiling

  • Convergent

  • Nearest

  • Round

  • Simplest

  • Zero

For more details, see rounding mode.

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

Use this parameter to specify the word and fraction lengths for the elements of the vector, V. You can set this parameter to:

  • A rule that inherits a data type, for example, Inherit: Same word length as input

  • An expression that evaluates to a valid data type, for example, fixdt(1,16,0)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Vector (V) data type parameter.

See Specify Data Types Using Data Type Assistant (Simulink) for more information.

Note

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

Dependencies

The Vector (V) parameter on the Data Types tab is visible only when you select Dialog parameter for the Vector (V) source parameter on the Main tab of the block mask.

Specify the output data type. See Fixed-Point Data Types for illustrations depicting the use of the output data type in this block. You can set it to:

  • A rule that inherits a data type, for example, Inherit: Same as first input

  • An expression that evaluates to a valid data type, for example, fixdt([],16,0)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output parameter.

See Control Data Types of Signals (Simulink) for more information.

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

  • Simulation range checking (see Specify Signal Ranges (Simulink))

  • Automatic scaling of fixed-point data types

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

  • Simulation range checking (see Specify Signal Ranges (Simulink))

  • Automatic scaling of fixed-point data types

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

double | fixed point | integer | single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

yes

Zero-Crossing Detection

no

More About

expand all

Algorithms

The Array-Vector Divide block divides 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 Divide along dimension parameter is set to 2, the output of the block Y(i,j,k) is given by:

Y(i,j,k)=A(i,j,k)V(j)

where

1iM1jN1kP

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