Documentation

validateModel

Class:Simulink.VariantConfigurationData
Package:万博1manbetx

Validate all variant blocks in the model and submodels in the hierarchy during simulation

Syntax

Simulink.VariantConfigurationData.validateModel(modelName)
Simulink.VariantConfigurationData.validateModel(modelName,configName)

Description

Simulink.VariantConfigurationData.validateModel(modelName), validates the model and referenced models during simulation.

Simulink.VariantConfigurationData.validateModel(modelName,configName), validates the model and referenced models during simulation optionally using a variant configuration.

Input Arguments

modelName

Name of the model

configName

Name of the configuration to be validated

Examples

% Add the path to the model file addpath(fullfile(docroot,'toolbox','simulink','examples')); % Load the model load_system('slexVariantManagementExample'); % Define the variant configuration data object vcdataObj = Simulink.VariantConfigurationData; % Add a variant configuration LinInterExp vcdataObj.addConfiguration('LinInterExp'); % Add control variables to LinInterExp vcdataObj.addControlVariables('LinInterExp',... cell2struct({'Ctrl', '1';... 'PlantLocation', '2';... 'SimType', '2'},... {'Name', 'Value'}, 2)); % Associate this object with the model set_param('slexVariantManagementExample',... 'VariantConfigurationObject', 'vcdataObj'); % Validate the model slexVariantManagementExample using % the configuration LinInterExp [valid, errors] = Simulink.VariantConfigurationData.validateModel... ('slexVariantManagementExample','LinInterExp')
Was this topic helpful?