Advisor.authoring.PositiveModelParameterConstraint class

Package: Advisor.authoring
Superclasses:

Create a Model Advisor constraint to check for supported model parameter values

Description

Instances of Advisor.authoring.PositiveModelParameterConstraint class define supported values for specified model parameters.

Construction

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

Properties

expand all

Unique identifier for the positive model parameter constraint. This property is read/write.

Model parameter for which you are specifying a constraint. This property is read/write.

List of supported values for the model parameter specified by the ParameterName field. 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 Model Parameter Values

These commands specify that the Solver Type model parameter must have a value of Variable-step:

c1=Advisor.authoring.PositiveModelParameterConstraint;
c1.ID='ID_1';
c1.ParameterName='SolverType';
c1.SupportedParameterValues={'Variable-step'};

These commands specify that the Stop time model parameter must have a value of 10 or 15:

c1=Advisor.authoring.PositiveModelParameterConstraint;
c1.ID='ID_1';
c1.ParameterName='StopTime';
c1.SupportedParameterValues={'10','15'};

For the ReplacementTypes model parameter (Embedded Coder Users), these commands specify two sets of supported values for the double and single data types:

c1 = Advisor.authoring.PositiveModelParameterConstraint();
c1.ID='ID_2';
c1.ParameterName = 'ReplacementTypes';
s1 = struct('double', 'a', 'single', 'b');
s2 = struct('double', 'c', 'single', 'b');
c1.SupportedParameterValues = {s1, s2};

Introduced in R2018a