Main Content

addCopyOfConfiguration

Class: Simulink.VariantConfigurationData
Package: Simulink

Add a copy of an existing variant configuration to the variant configuration data object

Syntax

vcdataObj.addCopyOfConfiguration(nameOfExistingConfiguration)
vcdataObj.addCopyOfConfiguration(nameOfExistingConfiguration, nameOfTobeAddedConfiguration)

Description

vcdataObj.addCopyOfConfiguration(nameOfExistingConfiguration), adds a new configuration with a default name (default name is based on existing configuration name being copied) as a copy of the existing configuration to the variant configuration data object.

vcdataObj.addCopyOfConfiguration(nameOfExistingConfiguration, nameOfTobeAddedConfiguration), adds a new configuration with a specified name, as a copy of the existing configuration, to the variant configuration data object.

Input Arguments

nameOfExistingConfiguration

Name of existing configuration.

nameOfTobeAddedConfiguration

Name of new configuration to be added as a copy of the configuration.

Examples

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

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

% Add a copy of variant configuration LinInterExp
% and name the copy as LinExtExp
vcdataObj.addCopyOfConfiguration('LinInterExp','LinExtExp')