isConfigActive
R2026bDescription
The function isConfigActive checks if the specified variant
configuration is the active configuration for a model. You can use this function when defining
variant constraints from Variant Manager. A constraint is a user defined check that you can
use to prevent invalid variant combinations in a model. The constraint must be satisfied by
all variant configurations created for the model. You specify constraints as condition
expressions that must evaluate to true. The expression can contain variant
control variables used by the model hierarchy as well as names of referenced configurations,
which are variant configurations for referenced components present in the hierarchy. You can
use the isConfigActive function to specify a referenced configuration
name in the condition expression of a constraint, either from the Variant Manager user
interface or by using the addConstraint function.
For more information on referenced configurations, see Compose Variant Configurations and Constraints for Top Model Using Referenced Configurations.
checks if the variant configuration tf = isConfigActive(varConfigs,nameOfConfig)nameOfConfig is the active
configuration for the model with which the Simulink.VariantConfigurations object varConfigs is
associated. The function compares the values of variant control variables used in
nameOfConfig with their values in the data source where they are
originally defined and returns a logical value 1 if the values match.
nameOfConfig must be defined in the object
varConfigs.