主要内容

Check Discrete Gradient

检查连续信号的连续样本之间的差异绝对值小于指定值

  • Library:
  • Simulink / Model Verification

    HDL Coder / Model Verification

  • Check Discrete Gradient block

Description

TheCheck Discrete Gradient块检查每个信号元素,并确定元素的连续值之间的差异的绝对值是否小于指定值。然后,块在比较之后执行断言。您可以指定渐变的值(1默认情况下)通过调整Maximum gradientparameter. If the input signal difference is less than the absolute value of theMaximum gradient, the assertion istrue (1)并且块没什么。如果不是,则块会停止模拟并默认返回错误消息。

Note

要运行模拟,检查离散梯度块需要固定步骤离散求解器。如果选择了另一个解算器,则会提示错误。

Ports

输入

expand all

输入signal the block checks to determine if the difference of each element between successive samples is less than the absolute value of theMaximum gradientparameter.

Data Types:single|double|int8|INT16|int32|int64|uint8|uint16|uint32|uint64|固定点

Output

expand all

Output signal that istrue (1)if the assertion succeeds, andfalse (0)如果断言失败。如果在配置Parameters window, in theMath and Data Typessection, underAdvanced parameters, you selectImplement logic signals as Boolean data, then the output data type isBoolean。否则,信号的数据类型是double

Dependencies

To enable this output port, select the输出断置信号parameter check box.

Data Types:double|Boolean

Parameters

expand all

Specify the value on the allowed gradient of the input signal.

Programmatic Use

范围:gradient
Type:string scalar or character vector
Values:real scalar
Default:“1”

Clearing this parameter disables the block and causes the model to behave as if the block does not exist. To enable or disable all verification blocks, regardless of the setting of this option, go to the Configuration Parameters window, clickDiagnostics>Data Validity, expand theAdvanced parameterssection, and set模型验证块启用toEnable all要么禁用所有

Programmatic Use

范围:enabled
Type:string scalar or character vector
Values:"on"|“离开”
Default:"on"

Specify a MATLAB®expression to evaluate when the assertion fails. Because the expression is evaluated in the MATLAB workspace, define all variables used in the expression in that workspace.

Dependencies

要启用此参数,请选择Enable assertionparameter.

Programmatic Use

范围:打回来
Type:string scalar or character vector
Default:""

Select this parameter to stop the simulation when the check fails. Clear this parameter to display a warning and continue the simulation.

Programmatic Use

范围:stopWhenAssertionFail
Type:string scalar or character vector
Values:"on"|“离开”
Default:"on"

Select this parameter to enable the output port.

Programmatic Use

范围:export
Type:string scalar or character vector
Values:"on"|“离开”
Default:“离开”

Specify the style of the block icon. Thegraphicoption displays a graphical representation of the assertion condition on the icon. Thetextoption displays a mathematical expression that represents the assertion condition.

Programmatic Use

范围:icon
Type:string scalar or character vector
Values:"graphic"|"text"
Default:"graphic"

块特征

Data Types

double|固定点|整数|single

直接喂养

Multidimensional Signals

yes

Variable-Size Signals

Zero-Crossing Detection

Extended Capabilities

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Fixed-Point Conversion
使用固定点设计器™设计和模拟定点系统。

Version History

在R2006A之前介绍