Main Content

addParameterConstraintRule

Class: Simulink.Mask.Constraints
Namespace: Simulink.Mask

Add rules to a parameter constraint

Syntax

paramConstRule = paramConstraint.addParameterConstraintRule(Name,Value)

Description

paramConstRule = paramConstraint.addParameterConstraintRule(Name,Value) adds rule to a parameter constraint.

Input Arguments

expand all

Handle to the mask parameter constraint for which you want to add constraint rules, specified as constraint object.

Data Types: char | cell

Name-Value Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Name-Value Pair for Rules

Name

Value

DataTypedouble, single, numeric, integer, int8, uint8, int16, uint16, int32, uint32, boolean, enum, fixdt
Dimensionscalar, row vector, column vector, 2-d matrix, n-d matrix
Complexityreal, complex
Signpositive, negative, zero
Finitenessfinite, inf, -inf, NaN
Minimumstring
Maximumstring
CustomConstraint

Valid MATLAB expression

Output Arguments

expand all

Mask constraint rule, specified as a cell array.

Examples

% Get mask constraint handle
paramConstraint = maskObj.getParameterConstraint('const3'); 

% Add rules to the constraint.
paramConstRule = paramConstraint.addParameterConstraintRule(...
                                                   'DataType','int8')

ans = 

  ParameterConstraintRules with properties:

            DataType: 'int8'
           Dimension: {0×1 cell}
          Complexity: {0×1 cell}
                Sign: {0×1 cell}
          Finiteness: {0×1 cell}
             Minimum: ''
             Maximum: ''
    CustomConstraint: ''

Version History

Introduced in R2018a