Simulink.VariantManager.activateModel
Syntax
Description
The Simulink.VariantManager.activateModel
function allows you to
validate and activate a variant configuration on the given model and any referenced components
in the model hierarchy. You can activate a named variant configuration defined for the model
or the workspace configuration (a temporary configuration based on current control variable
values in the data sources used by the model).
The process checks if the variant elements in the model, such as variant blocks, variant controls, constraints, and the variant configuration, are set up correctly. When you activate a configuration using this function, it:
Checks if applicable constraints are satisfied
Pushes the variant control variables to the data sources where the variables are stored, for use in simulation and code generation workflows
Reports an error if the activation fails
Activation of a variant configuration performed by this function differs from the Simulink® update diagram process. See Differences Between Variant Manager Activation and Update Diagram Process.
Simulink.VariantManager.activateModel(
validates and activates the workspace configuration on the model hierarchy. The variant
control variables must be defined in the data sources used by the model.modelName
)
Simulink.VariantManager.activateModel(
validates and activates the specified named variant configuration on the model
hierarchy.modelName
,Configuration=configName
)
You can use model compilation information when activating a variant configuration to
produce more accurate activation results. See Simulink.VariantManager.updateModel
.
Note
To use this function, you must install the Variant Manager for Simulink support package.
Examples
Input Arguments
Alternative Functionality
You can activate a variant configuration on a model using the Variant Manager user interface. For details, see Create and Activate Variant Configurations.