Main Content

addPortConstraintAssociation

Class: Simulink.Mask
Namespace: Simulink

Associate port constraints to port identifiers

Since R2022a

Syntax

aMaskObj.addPortConstraintAssociation(name, port identifiers)

Description

aMaskObj.addPortConstraintAssociation(name, port identifiers) associates specified port constraint to the specified port identifiers. You can associate multiple port identifiers to the same port constraint.

Input Arguments

expand all

Name of the port constraint, specified as a string.

Data Types: char | string

Name of the port identifiers, specified as a cell array. You can associate same port constraint with multiple port identifiers.

Data Types: cell

Examples

% Get a mask object
aMaskObj = Simulink.Mask.get(gcb);
aMaskObj.PortIdentifiers;
aMaskObj.addPortConstraintAssociation('pc3',{'pi_1'});

Version History

Introduced in R2022a