Advisor.authoring.PositiveBlockTypeConstraint class

Package: Advisor.authoring
Superclasses:

Create a Model Advisor constraint to check for supported block types

Description

Instances of Advisor.authoring.PositiveBlockTypeConstraint class define the only blocks that a model can contain.

Construction

constraint = Advisor.authoring.PositiveBlockTypeConstraint() creates an instance of this class.

Properties

expand all

Unique identifier for the positive block type constraint. This property is read/write.

Structure consisting of these fields:

  • ''BlockType'

  • 'MaskType'

List of supported block types. For more information on the MaskType field, see Mask Editor Overview (Simulink) and Mask Parameters (Simulink).This property is read/write.

IDs of constraints that you specify as prerequisites by using the addPreRequisiteConstraintID method. If a prerequisite is not satisfied, the Model Advisor does not check the constraint that has the prerequisite. This property is read-only.

Examples

Specify Supported Block Types

These commands specify that a model contain only Inport, Outport, and Gain blocks and Constant blocks that have a specified mask:

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;};

Introduced in R2018a