isConfigActive
Description
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 component configurations,
which are variant configurations for referenced components present in the hierarchy. You can
use the isConfigActive
function to specify a component 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 component configurations, see Compose Variant Configurations and Constraints for Top Model Using Referenced Component Configurations.
checks if the variant configuration tf
= isConfigActive(varconfigdata
,nameofconfig
)nameofconfig
is the active
configuration for the model with which the Simulink.VariantConfigurationData
object varconfigdata
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
varconfigdata
.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2025a