Package: Simulink
Class representing a variant configurations data object
The variant configuration data object, stores a collection of
variant configurations, constraints, and the name of the default active
configuration. The Simulink.VariantConfigurationData
class
has properties that enable you to add, modify, or remove variant configurations,
constraints, and control variables. Use an instance of Simulink.VariantConfigurationData
class
to do the following:
Define and edit variant configurations.
Add control variables to variant configurations.
Add copy of variant configuration.
Delete existing variant configurations, constraints, and sub model configurations.
Set a specific configuration as default active.
Validate model using default or a specific variant configuration.
Query or create variant configurations data object for a given model.
|
Set of variant configurations. The names of the configurations must be unique and valid MATLAB® variable names. |
|
Set of constraints that must always be satisfied by the model for all variant configurations. The name of the constraints must be unique and valid MATLAB variable names. |
|
Name of the variant configuration to be used by default for validation. |
VariantConfigurationData | Object constructor with optional arguments for variant configurations, constraints, and default configuration name |
addConfiguration | Add a new variant configuration to the variant configuration data object |
addConstraint | Add a constraint to the variant configuration data object |
addControlVariables | Add control variables to an existing variant configuration |
addCopyOfConfiguration | Add a copy of an existing variant configuration to the variant configuration data object |
addSubModelConfigurations | Add to a variant configuration the names of the configurations to be used for submodels |
existsFor | Check if variant configuration data object exists for a model |
getConfiguration | Returns the variant configuration with a given name from a variant configuration data object |
getDefaultConfiguration | Returns default variant configuration, if any, for a variant configuration data object |
getFor | Get existing variant configuration data object for a model |
getOrCreateFor | Get existing or create a new variant configuration data object for a model |
removeConfiguration | Remove a variant configuration with a given name from the variant configuration data object |
removeConstraint | Remove a constraint from the variant configuration data object |
removeControlVariable | Remove a control variable from a variant configuration |
removeSubModelConfiguration | Remove from a variant configuration, the configuration to be used for a sub model. |
setDefaultConfigurationName | Set name of the default variant configuration for a variant configuration data object |
validateModel | Activate and validate all variant blocks in a model hierarchy |
load_system(model); % Create variant config and associate it with model variantConfig = Simulink.VariantConfigurationData; set_param(model, 'VariantConfigurationObject', 'variantConfig');