Main Content

getDependentModels

Class: Simulink.VariantConfigurationAnalysis
Package: Simulink

List of dependent models that are used in a named variant configuration

Syntax

dependentModels = varConfigObj.getDependentModels(configName)

Description

Use this method to find the dependent models used 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 getDependentModels method.

Note

This method requires Variant Manager for Simulink®.

dependentModels = varConfigObj.getDependentModels(configName) returns a list of dependent models that are used 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 dependent models, specified as a character vector. You must analyze this configuration using the Simulink.VariantConfigurationAnalysis class first.

Output Arguments

expand all

List of dependent models, returned as a cell array.

Examples

% Add model to path
addpath(fullfile(matlabroot,'examples','simulink_variants','main'));

% Open model
open_system('slexVariantManagement'); 

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

% Get dependent models
dependentModels = varConfigObj.getDependentModels('NonLinExterLowFid')

Version History

Introduced in R2019a