Main Content

getOrCreateFor

Class: Simulink.VariantConfigurationData
Package: Simulink

Get existing or create a new variant configuration data object for a model

Syntax

Simulink.VariantConfigurationData.getOrCreateFor(modelNameOrHandle)

Description

Simulink.VariantConfigurationData.getOrCreateFor(modelNameOrHandle), returns the object if the variant configuration data objects exists otherwise, creates an empty object.

Input Arguments

modelNameOrHandle

Model name or handle to the model.

Examples

% Add the path to the model file
addpath(fullfile(docroot,'toolbox','simulink','examples'));

% Load the model
load_system('slexVariantManagement');

% Obtain existing or create an empty variant configuration
% data object for the slexVariantManagement model
vcdataObj = Simulink.VariantConfigurationData.getOrCreateFor...
  ('slexVariantManagement')