Simulink.VariantConfigurationData
Create and store variant configurations and constraints
Description
Note
This object requires Variant Manager for Simulink®.
Use a Simulink.VariantConfigurationData
object to store a
collection of variant configurations, constraints that must be satisfied by the
configurations, and the name of a preferred variant configuration for a model. You can define
the variant configuration data object in the base workspace or in the
Configurations section of a Simulink data dictionary.
A variant configuration represents a specific set of variation points across the model
hierarchy. It contains a group of variant control variables and their values, which you can
use to activate a specific variant in the model hierarchy. A
Simulink.VariantConfigurationData
object enables you to:
Define new variant configurations.
Add variant control variables to a variant configuration.
Define constraints to check for invalid variant configurations.
Add or remove association between variant configurations of top-level model and referenced model.
Delete existing variant configurations, constraints, and control variables.
Set a specific configuration as the preferred variant configuration.
Creation
Syntax
Description
creates an empty varconfigdata
= Simulink.VariantConfigurationDataVariantConfigurationData
object.
creates a varconfigdata
= Simulink.VariantConfigurationData(PropertyName=Value
)VariantConfigurationData
object and sets its properties using
one or more property name-value arguments.
Properties
Object Functions
addConfiguration | Add new variant configuration to variant configuration data object |
addComponentConfiguration | Associate top-model variant configuration with variant configuration of referenced model |
addConstraint | Add constraint to variant configuration data object |
addControlVariables | Add variant control variables to named variant configuration in variant configuration data object |
addCopyOfConfiguration | Add copy of existing variant configuration to variant configuration data object |
convertDefaultToPreferred | Convert default variant configuration to preferred variant configuration |
getConfiguration | Get specific variant configuration from variant configuration data object |
getComponentConfigurationName | Get name of variant configuration used by referenced component in model hierarchy |
getPreferredConfiguration | Get name of preferred variant configuration for variant configuration data object |
isConfigActive | Check if variant configuration is active |
setPreferredConfiguration | Set name of preferred variant configuration for variant configuration data object |
removeConfiguration | Remove variant configuration from variant configuration data object |
removeComponentConfiguration | Remove association between variant configurations of top-level model and referenced model |
removeConstraint | Remove constraint from variant configuration data object |
removeControlVariable | Remove variant control variable from variant configuration |
These functions specialize standard MATLAB set operations for Simulink.VariantConfigurationData
objects.
intersect |
Find the
intersection of variant configuration data objects Constraints in
Then,
The constraint conditions formed by logical
The remaining properties of |
setdiff |
Find the
difference between variant configuration data objects Constraints in
Then,
The constraint conditions formed by logical
The remaining properties of |
union |
Find the union of
variant configuration data objects Constraints in
Then,
The constraint conditions formed by logical
The remaining properties of |
unique |
Find unique configurations in the variant configuration data object
Duplicate configurations in
|
Examples
Tips
You can edit a variant configuration object from the base workspace or data dictionary
without launching Variant Manager. Double-click the object in the base workspace or in the
Configurations section of the data dictionary in the Model Explorer.
This action launches the Simulink.VariantConfigurationData
property dialog box.
This dialog box functions as a standalone variant manager and allows you to modify variant
configurations, control variables, and constraints in the variant configuration object.