Main Content

Simulink.VariantManager class

Package: Simulink

Access Variant Manager functionality programmatically

Description

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:

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

  • Find variant control variables used in variant control expressions.

  • Generate a reduced model for specified variant configurations.

  • Display or control behavior of variant condition legend.

Creation

variantmanager = Simulink.VariantManager creates a variant manager object.

Methods

expand all

Examples

collapse all

Open the model slexVariantManagement.

cd(fullfile(matlabroot,'examples','simulink_variants','main'));
model = 'slexVariantManagement';
open_system(model); 

Create an object of the Simulink.VariantManager class.

varmngr=Simulink.VariantManager;

Find the variant control variables.

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

Version History

Introduced in R2016a