Main Content

Simulink.VariantManager class

Package: Simulink

Access Variant Manager functionality programmatically

Description

Note

This class requires Variant Manager for Simulink®.

The variant manager class provides a set of methods to access Variant Manager functionality from the MATLAB® command line. 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.

  • Convert a Variant Subsystem block to a Variant Assembly Subsystem block.

  • Convert Subsystem or Model block to a Variant Subsystem block.

  • Display or control the behavior of the variant condition legend.

Methods

expand all

Examples

collapse all

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