Main Content

Create Interchangeable Variations of Model Components

To add flexibility to a model so that it can cater to different requirements, you can use variant subsystems and models. Variants allow you to choose among multiple variations of a component within a single model. You can change the active variant without modifying the model by changing the values of variant control variables at the MATLAB® command prompt.

Model ex_modeling_variants includes three variant choices for the operator subsystem.

Operator 1 is the active variant, which is defined by script ex_modeling_variant_choice.m. To determine the goal position for the mechanical system, this operator implements procedural logic with a Stateflow® chart.

Inactive variants and their contents are grayed out. To define the goal position for the mechanical system position, inactive variant subsystem Operator 2 uses a Waveform Generator block.

Variant choice Operator 3 is an inactive variant model. Variant Subsystem blocks allow both subsystems and models as variant choices.

Related Topics