Main Content


Class: Simulink.VariantConfigurationAnalysis
Package: Simulink

List of active blocks in a named variant configuration


activeBlocks = varConfigObj.getActiveBlocks(configName)


Use this method to find the active blocks in a named variant configuration after analyzing it using the Simulink.VariantConfigurationAnalysis class. You must create a variant configuration analysis object of type Simulink.VariantConfigurationAnalysis for a model and use it to analyze the required named variant configurations for that model before calling the getActiveBlocks method.


This method requires Variant Manager for Simulink®.

activeBlocks = varConfigObj.getActiveBlocks(configName) returns the list of active blocks in the variant configuration named configName. varConfigObj is the VariantConfigurationAnalysis object for a model.

Input Arguments

expand all

Name of the variant configuration for which you want to find the active blocks, specified as a character vector. You must analyze this configuration using the Simulink.VariantConfigurationAnalysis class first.

Output Arguments

expand all

List of active blocks in the input variant configuration, returned as a cell array.


% Add model to path

% Open model

% Get variant configuration analysis object
varConfigObj = Simulink.VariantConfigurationAnalysis('slexVariantManagement', 'NamedConfigurations', {'LinInterStd', ...
'NonLinExterLowFid', 'NonLinExterHighFid'})

% Get active blocks
ActiveBlocks = varConfigObj.getActiveBlocks('LinInterStd')

Version History

Introduced in R2019a