Main Content

validateModel

Class: Simulink.VariantConfigurationData
Package: Simulink

Activate and validate all variant blocks in a model hierarchy

Syntax

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

Description

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

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

Note

Activation of a variant configuration performed by this method differs from the Simulink® update diagram process. See Differences Between Variant Manager Activation and the Update Diagram Process.

Input Arguments

modelName

Name of the model

configName

Name of the configuration to be activated and validated

Examples

  1. Add the path to the model file.

    addpath(fullfile(matlabroot,'examples','simulink_variants','main'));
    

  2. Load the model.

    load_system('slexVariantManagement');

  3. Activate and validate the model slexVariantManagement using the configuration LinInterExpNoNoise.

    [valid, errors] = Simulink.VariantConfigurationData.validateModel...
      ('slexVariantManagement','LinInterExpNoNoise')