|On this page…|
At the MATLAB® command line, set the variant control variable to the variant choice that you want to make active. For example, in the model sldemo_variant_subsystemssldemo_variant_subsystems, set VSS_MODE=2 to make the Second-Order Controller the active variant.
Right-click the block and select Variant > Override using > variant choice.
In the block parameter dialog box, select the Override variant conditions and use the following variant check box. Select the variant that you want to set as the active variant as the Variant value.
Use the set_param command to override the active variant.
For example, to make the variant choice VSS_NONLINEAR_CONTROLLER active:
Variant control names which are empty or commented (starts with a %) are ignored in selecting active variants.
When you open a model, variant blocks display the name of the variant that was active the last time that you saved model was saved. You can use the Variant menu to open the active variant. Right-click the block and select Variant > Open > (active variant).
To find the current active variant block, at the command line, enter:
To find the path to the current active variant block, at the command line, enter: