Main Content

Simulink.Mask.CrossPortParameterConstraint Class

Namespace: Simulink.Mask

Cross port parameter constraint between ports and parameters of same masked block

Since R2025a

Description

The Simulink.Mask.CrossPortParameterConstraint class is a handle class.

Use an instance of Simulink.Mask.CrossPortParameterConstraint to create cross port parameter constraints among ports and parameters of the same masked block.

Creation

crossPortParamConsObj = Simulink.Mask.CrossPortParameterConstraint creates an empty cross port parameter constraint object. Create cross port parameter constraint using the addCrossPortParameterConstraint method.

Properties

expand all

Name of the cross port parameter constraint, specified as string scalar or character vector.

Example: crossPortParamConsObj.Name = "checkDataType"

Data Types: string | char

Rule associated with the cross port parameter constraint specified as one of these values.

  • None:— No specific rule or requirement is defined between the port and the parameter.

  • Same DataType:— The data type of the port and the parameter must match.

  • Same Dimension:— The dimension (e.g., scalar, vector, matrix) of the port and the parameter must be identical.

  • Same Complexity:— The complexity, for example: real vs. complex numbers of the data at the port and the parameter must be the same.

Example: crossPortParamConsObj.Rule = "SameDimension"

Data Types: string | char

Parameter conditions for the cross port parameter constraint, specified as cell array. The cross port parameter constraint is active on the associated ports and parameters only when it satisfies the parameter conditions.

Example: crossPortParamConsObj.ParameterConditions = {'Name', {'Speed'}, 'Values', {'10','20'}}

Data Types: cell

Port and parameter associations to apply to cross port parameter constraint, specified as Simulink.Mask.CrossPortParameterAssociation object.

Example: crossPortParamConsObj.Associations = assoc

Type of diagnostic message displayed when validation fails, specified as "error" or "warning".

Example: crossPortParamConsObj.DiagnosticLevel = "error"

Data Types: string | char

Diagnostic message to display when validation fails, specified as character vector or string scalar.

Example: crossPortParamConsObj.DiagnosticMessage = "The input port and parameters must be of same data type"

Data Types: string | char

Methods

expand all

Version History

Introduced in R2025a