convertDefaultToPreferred
Class: Simulink.VariantConfigurationData
Namespace: Simulink
Convert default variant configuration to preferred variant configuration
Since R2022b
Description
Setting a default variant configuration for a variant configuration data object is not recommended. If the variant configuration data object associated with your model has an existing default configuration, you can convert it to the preferred variant configuration using this method.
Note
This method requires Variant Manager for Simulink®.
vcdataObj.convertDefaultToPreferred()
sets the existing
DefaultConfiguration
property of vcdataObj
to its
PreferredConfiguration
property and then clears the
DefaultConfiguration
property. vcdataObj
is an
object of the Simulink.VariantConfigurationData
class.
vcdataObj.convertDefaultToPreferred(
sets the existing model
,Name=Value
)DefaultConfiguration
property of
vcdataObj
to its PreferredConfiguration
property
and clears the DefaultConfiguration
. It additionally updates the model
callback functions specified using Name=Value
arguments to activate the
preferred variant configuration on the model.
The preferred variant configuration is not applied automatically when compiling or
simulating a model. You must apply the preferred configuration explicitly on the model, if
required. To additionally activate the preferred configuration on the model, you can set the
Name=Value
arguments in this method to add commands to the
PostLoadFcn
or InitFcn
callbacks or both.
Input Arguments
Examples
Version History
Introduced in R2022b