Main Content

getDefaultConfiguration

Class: Simulink.VariantConfigurationData
Package: Simulink

Returns default variant configuration, if any, for a variant configuration data object

Syntax

vcdataObj.getDefaultConfiguration

Description

vcdataObj.getDefaultConfiguration returns the default variant configuration. If no default variant configuration is defined, then [] is returned.

Note

Setting a default variant configuration for a variant configuration data object is not recommended. Activate and validate the model using a specific variant configuration instead. If you set a default configuration, compiling or simulating the model will apply the default configuration irrespective of the variant control variable values in the global workspace.

Examples

% Define the variant configuration data object
vcdataObj = Simulink.VariantConfigurationData;

% Add the variant configuration named LinInterExp
vcdataObj.addConfiguration('LinInterExp',...
  'Linear Internal Experimental Plant Controller');

% Add the variant configuration LinInterStd
vcdataObj.addConfiguration('LinInterStd',...
  'Linear Internal Standard Plant Controller');

% Set LinExtExp as the default variant configuration
vcdataObj.setDefaultConfigurationName('LinInterExp');
  
% Obtain the default variant configuration
defvc = vcdataObj.getDefaultConfiguration