Main Content

Advisor.authoring.PositiveBlockTypeConstraint 类

命名空间: Advisor.authoring
超类:

创建模型顾问约束以检查受支持的模块类型

描述

Advisor.authoring.PositiveBlockTypeConstraint 类的实例定义模型只能包含的模块。

构造

constraint = Advisor.authoring.PositiveBlockTypeConstraint() 创建此类的一个实例。

属性

全部展开

正向模块类型约束的唯一标识符。此属性是可读取/写入的。

由以下字段组成的结构:

  • ''BlockType'

  • 'MaskType'

受支持的模块类型列表。有关 MaskType 字段的详细信息,请参阅封装编辑器概述封装参数。此属性是可读取/写入的。

使用 addPreRequisiteConstraintID 方法指定为前提条件的约束的 ID。如果不满足某个前提条件,模型顾问不会检查具有该前提条件的约束。此属性是只读的。

示例

指定受支持的模块类型

以下命令指定模型只能包含 InportOutportGain 模块以及具有指定封装的 Constant 模块:

c1=Advisor.authoring.PositiveBlockTypeConstraint;
c1.ID='ID_1';
s1=struct('BlockType','Inport','MaskType','');
s2=struct('BlockType','Outport','MaskType','');
s3=struct('BlockType','Gain','MaskType','');
s4=struct('BlockType','Constant','MaskType','Stateflow');
c1.SupportedBlockTypes={s1;s2;s3;s4;};

版本历史记录

在 R2018a 中推出