Main Content

addSubModelConfigurations

Class: Simulink.VariantConfigurationData
Package: Simulink

Add to a variant configuration the names of the configurations to be used for submodels

Syntax

vcdataObj.addSubModelConfigurations(nameOfConfiguration,subModelConfigurations)

Description

vcdataObj.addSubModelConfigurations(nameOfConfiguration,subModelConfigurations), specifies names of the configurations to be used for submodels.

Input Arguments

nameOfConfiguration

Name for the configuration of submodels that are model references.

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

  1. Add the path to the model file.

    addpath(fullfile(docroot,'toolbox','simulink','examples'));

  2. Load the model.

    load_system('slexVariantManagement');
  3. Obtain variant configuration data object for the model.

    vcdataObj = Simulink.VariantConfigurationData.getFor('slexVariantManagement');
  4. Add a new submodel configuration to LinInterExpNoNoise.

    vcdataObj.addSubModelConfigurations('LinInterExpNoNoise',...
      [struct('ModelName', 'slexVariantManagementExternalPlantMdlRef',...
              'ConfigurationName', 'LowFid')])