Main Content

validateModel

Class: Simulink.VariantConfigurationData
Namespace: Simulink

(To be removed) Validate and activate variant blocks in a model hierarchy

validateModel will be removed in a future release. Use Simulink.VariantManager.activateModel instead.

Description

The validateModel method allows you to validate and activate a variant configuration on a model hierarchy. You can activate a named variant configuration defined for the model or the workspace configuration (temporary configuration in the base workspace or data dictionary used by the model).

The process validates if the variant elements in the model such as variant blocks, variant controls, constraints, and the variant configuration are set up correctly. Activating a configuration:

  • Checks if applicable constraints are satisfied

  • Applies the variant control variable values defined in the configuration on the model

  • Pushes the variant control variable values to the base workspace or data dictionary used by the model, for use in simulation and code generation workflows

[valid,errors] = vcdataObj.validateModel(modelName), where vcdataObj is an object of the Simulink.VariantConfigurationData class, returns the result of validating and activating the workspace configuration on the model hierarchy. The variant control variables must be defined in the base workspace or data dictionary used by the model.

[valid,errors] = vcdataObj.validateModel(modelName,configName) returns the result of validating and activating the specified named variant configuration on the model hierarchy.

Note

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

For more information on the types of variant configurations, see .

Input Arguments

expand all

Name of the model, specified as character vector.

Example: "slexVariantManagement"

Data Types: char

Name of the variant configuration to be validated and activated, specified as character vector.

Example: "LinInterExpNoNoise"

Data Types: char

Output Arguments

expand all

True or false result, returned as a 1 or 0 of data type logical.

List of errors, returned as an N*1 structure where N is the number of models with errors. The structure has these fields:

FieldTypeDescription
Modelchar

Name of the model

Errorsstructure

An M*1 structure where M is the number of errors in the model. The structure has these fields:

  • Message

  • MessageID

Version History

Introduced in R2013b

expand all