main Content

一个rray-Vector Add

沿指定维度添加向量到数组

Library

数学功能 /矩阵和线性代数 /矩阵操作

DSPMTRX3

  • 一个rray-Vector Add block

描述

阵列矢量添加块在指定维度中添加了值n-dimensional input array一个输入向量中的值v

这length of the inputv必须与指定维度的长度相同一个。这一个rray-Vector Add block adds each element ofvto the corresponding element along that dimension of一个

考虑三维m-by-n-by-p输入数组A(i,j,k)n-b-1输入向量v。当。。。的时候一个dd along dimensionparameter is set to2,,,,the output of the blocky((一世,,,,j,,,,k)

y (( 一世 ,,,, j ,,,, k = 一个 (( 一世 ,,,, j ,,,, k + v (( j

在哪里

1 一世 m 1 j n 1 k p

这output of the Array-Vector Add block is the same size as the input array,一个。该块接受真实且复杂的浮点和固定点输入。

Fixed-Point Data Types

下图显示了固定点信号的数组 - 矢量添加块中使用的数据类型。

指定向量时vmain块蒙版的窗格,您必须指定其元素的数据类型和缩放属性vector (V)参数数据类型tab. When the vector comes in through the block port, its elements inherit their data type and scaling from the driving block.

您可以在“块”对话框中设置向量,累加器和输出数据类型,如下所述。

参数

main Tab

一个dd along dimension

Specify the dimension along which to add the input array一个to the elements of vectorv

向量(v)源

Specify the source of the vector,v。这vector can come from the输入端口或来自对话参数

vector (V)

指定向量,v。仅当您选择时才可见此参数对话参数for the向量(v)源范围。

数据类型选项卡

笔记

浮点继承优先于该窗格上定义的数据类型设置。当输入是浮点时,块会忽略这些设置,所有内部数据类型都是浮点。

舍入模式

指定定点操作的舍入模式为以下一项:

  • Floor

  • 天花板

  • 收敛

  • 最近

  • Round

  • Simplest

有关更多详细信息,请参阅rounding mode

如果累加器data type is继承:通过内部规则继承and输出data type is继承:与累加器相同, 的价值舍入模式does not affect the numerical results.

笔记

舍入模式andSaturate on integer overflowsettings have no effect on numerical results when both of these conditions are met:

  • 累加器继承:通过内部规则继承

  • 输出继承:与累加器相同

With these data type settings, the block is effectively operating in full precision mode.

Saturate on integer overflow

当您选择此参数时,块会饱和其定点操作的结果。当您清除此参数时,该块包含其定点操作的结果。有关详细信息saturateand, 看overflow mode用于定点操作。

vector (V)

使用此参数来指定向量元素的单词和分数长度,v。您可以将此参数设置为:

  • 继承数据类型的规则,例如Inherit: Same word length as input

  • 一个n expression that evaluates to a valid data type, for example,FIXDT(1,16,0)

Click the显示数据类型助手按钮显示数据类型助手,这可以帮助您设置累加器范围。

使用数据类型助手指定数据类型(金宝appSimulink)了解更多信息。

笔记

vector (V)参数数据类型窗格仅在选择时才可见对话参数for the向量(v)源参数mainpane of the block mask. 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.

累加器

指定累加器数据类型。看Fixed-Point Data Types对于显示该块中累加器数据类型的图表。您可以将此参数设置为:

  • 继承数据类型的规则,例如继承:通过内部规则继承。For more information on this rule, seeInherit via Internal Rule

  • 继承数据类型的规则,例如继承:与第一输入相同

  • 一个n expression that evaluates to a valid data type, for example,FIXDT(1,16,0)

Click the显示数据类型助手按钮显示数据类型助手,这可以帮助您设置累加器范围。

使用数据类型助手指定数据类型(金宝appSimulink)了解更多信息。

输出

指定输出数据类型。看Fixed-Point Data Types对于描述该块中输出数据类型的使用的插图。您可以将其设置为:

  • 继承数据类型的规则,例如继承:与累加器相同

  • 继承数据类型的规则,例如继承:与第一输入相同

  • 一个n expression that evaluates to a valid data type, for example,FIXDT(1,16,0)

Click the显示数据类型助手按钮显示数据类型助手,这可以帮助您设置输出范围。

Control Data Types of Signals(金宝appSimulink)了解更多信息。

最低限度

指定块应输出的最小值。默认值是[](未指定)。金宝appSimulink®软件使用此值执行:

  • 模拟范围检查(请参阅指定信号范围(金宝appSimulink)

  • 定点数据类型的自动缩放

maximum

指定块应输出的最大值。默认值是[](未指定)。金宝appSimulink使用此值执行:

  • 模拟范围检查(请参阅指定信号范围(金宝appSimulink)

  • 定点数据类型的自动缩放

锁定数据类型设置,以通过定点工具更改针对更改

选择此参数,以防止定点工具覆盖您在块蒙版上指定的数据类型。

Supported Data Types

港口 Supported Data Types

一个

  • Double-precision floating point

  • Single-precision floating point

  • 固定点(仅签名)

  • 8-, 16-, and 32-bit signed integers

v

  • Double-precision floating point

  • Single-precision floating point

  • 固定点(仅签名)

  • 8-, 16-, and 32-bit signed integers

输出

  • Double-precision floating point

  • Single-precision floating point

  • 固定点(仅签名)

  • 8-, 16-, and 32-bit signed integers

扩展功能

C/C ++代码生成
使用Simulink®Coder™生成C和C ++代码。金宝app

在R2007B中引入