Main Content

addConfiguration

Class: Simulink.VariantConfigurationData
Package: Simulink

Add a new variant configuration to the variant configuration data object

Syntax

vcdataObj.addConfiguration(name)
vcdataObj.addConfiguration(name,description)
vcdataObj.addConfiguration(name,description,controlVars)
vcdataObj.addConfiguration(name,description,controlVars,subModelConfigurations)

Description

vcdataObj.addConfiguration(name) adds a new variant configuration with a given name to the variant configuration data object.

vcdataObj.addConfiguration(name,description) adds a new variant configuration with a given name and optional description to the variant configuration data object.

vcdataObj.addConfiguration(name,description,controlVars) adds a new variant configuration with a given name, optional description, and control variables to the variant configuration data object.

vcdataObj.addConfiguration(name,description,controlVars,subModelConfigurations) adds a new variant configuration with a given name, optional description, control variables, and submodel configurations to the variant configuration data object.

Input Arguments

name

Name of variant configuration being added.

description

Description text for the variant configuration being added.

controlVars

Control variables for the variant configuration being added. This argument must be a vector of structures with required fields: Name and Value. The values assigned to the Name field must be unique and valid MATLAB® variable names. The Value field can contain either character vectors or Simulink.Parameter objects. The values of control variables are checked during validation of the variant configuration.

subModelConfigurations

Vector of structures containing fields: ModelName, ConfigurationName. The names of submodels must be unique and valid MATLAB variable names and configuration names must be valid MATLAB variables.

Examples

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

% Add a variant configuration LinInterExp 
vcdataObj.addConfiguration('LinInterExp')