Class: Simulink.Mask
Package: Simulink
Add parameter constraint to a mask
paramConstraint = maskObj.addParameterConstraint(Name,Value)
adds a constraint to the specified mask. Constraints can only be associated to the
Edit type mask parameters.paramConstraint
= maskObj
.addParameterConstraint(Name,Value
)
% Get block mask handle. maskObj = Simulink.Mask.get(gcb); % Create mask constraint with single rule. paramConstraint = maskObj.addParameterConstraint('Name','const2',... 'Parameters',{'Parameter2'}, 'Rules', {'DataType', 'uint8'})
ans = Constraints with properties: Name: 'const2' ConstraintRules: [1×1 Simulink.Mask.ParameterConstraintRules]
% Get block mask handle. maskObj = Simulink.Mask.get(gcb); % Create mask constraint with multiple rules. paramConstraint = maskObj.addParameterConstraint('Name','const3',... 'Parameters',{'Parameter3'}, 'Rules', {{'DataType', 'uint8'},{'DataType', {'fixdt(1,8,4)'}}})
ans = Constraints with properties: Name: 'const3' ConstraintRules: [1×2 Simulink.Mask.ParameterConstraintRules]