Main Content


Class: Simulink.VariantManager
Package: Simulink

Apply specified variant configuration to model

Since R2022b



This method requires Variant Manager for Simulink®.


Simulink.VariantManager.applyConfiguration(model,Configuration=configname) applies the variant configuration specified by configname to the model model and any referenced components in the model hierarchy.

The variant configuration named configname must be present in the VariantConfigurationData object associated with model. The operation exports the variant control variables defined in the specified configuration to the base workspace or data dictionary used by the model.

This method allows you to quickly switch the variant configuration for a model. The method does not validate the configuration. To validate and activate a model using a specific configuration or using the currently applied configuration, use the Simulink.VariantManager.activateModel method.

Input Arguments

expand all

Name of the model to which the specified variant configuration must be applied, specified as a character vector or string.

Example: "slexVariantManagement"

Data Types: char | string

Name of the variant configuration that must be applied to the model, specified as a character vector or string.

Example: "Config1"

Data Types: char | string


expand all

Open the model slexVariantManagement.


The model has multiple named variant configurations stored in the variant configuration data object vcd associated with the model.

Apply the configuration LinInterExpNoNoise to the model.


Version History

Introduced in R2022b