Main Content

Simulink.VariantManager class

Package: Simulink

Access Variant Manager functionality programmatically

Description

Note

This class requires Variant Manager for Simulink®.

The Simulink.VariantManager class provides a set of methods to access Variant Manager functionality programmatically. Use an instance of Simulink.VariantManager class to:

  • Apply a variant configuration to a model.

  • Validate and activate a variant configuration in a model.

  • Automatically generate all possible variant configurations for a model.

  • Generate a reduced model for specified variant configurations.

  • Get the VariantConfigurationData object associated with a model.

  • Get the name of the preferred variant configuration for a model.

  • Find variant control variables used in variant control expressions in a model.

Methods

expand all

Examples

collapse all

This example shows how to find the variant control variables used in a model.

Open the model slexVariantManagement.

model = 'slexVariantManagement';
open_system(model); 

Find the variant control variables.

vars = Simulink.VariantManager.findVariantControlVars(model)
vars=6×1 struct array with fields:
    Name
    Value
    Exists
    Source
    SourceType

Version History

Introduced in R2016a

expand all