Variant Parameter Values
With variant parameters, you can represent value variations of a system in a single model. You can group different sets of values based on the variant to simulate. You can activate each set of values depending on the variant control. You can incorporate variant parameters in any Simulink® block.
Suppose you want to simulate a model that represents an automobile system with several configurations. These configurations, although similar in several aspects, can differ in values such as fuel consumption, engine size, or number of cylinders in the engine. Instead of designing multiple blocks that together represent all possible values, you can use variant parameters to model the varying values and then switch between the values based on the variant control you select. For more information, see Introduction to Variant Controls.
You can use Variant Manager for Simulink to manage variant parameters in your model.
The code that you generate for variant parameters can contain all the possible values of a system. You can switch between the values prior to code compile or at model startup as described in Activate Variant During Different Stages of Simulation and Code Generation Workflow. For more information, see Options to Represent Variant Parameters in Generated Code (Embedded Coder).
Classes
Simulink.VariantVariable | Create variant parameter object (Since R2021a) |
Simulink.VariantBank | Group all variant parameter values in structure array in generated code (Since R2023a) |
Simulink.VariantBankCoderInfo | Specify code generation properties for variant parameter bank (Since R2023a) |
Simulink.Variant | Specify conditions that control variant selection |
Simulink.VariantControl | Create a variant control variable object (Since R2021a) |
Simulink.Parameter | Store, share, and configure parameter values |
Functions
enumeration | Class enumeration members and names |
Topics
- Use Variant Parameters to Reuse Block Parameters with Different Values
Design one model for many variants of a system that differ in block parameter values.
- Variant Control Mode in Variant Parameters
Learn the types of variant control modes, variant control variables, storage locations, and activation times supported by variant parameters.
- Use Variant Control Variables in Variant Parameters
See examples of when and how to use different types of variant control variables in variant parameters.
Related Information
- Variant Systems (Embedded Coder)