Main Content

Variant Systems

Create custom model versions to support different specifications, without duplication

In Simulink®, you can create models that are based on a modular design platform that comprises a fixed common structure with a finite set of variable components. The variability helps you develop a single, fixed master design with variable components.

The approach helps you meet diverse customer requirements that are governed by application, cost, or operational considerations.

Variants are the variable components of modular design platforms. They help you specify multiple implementations of a model in a single, unified block diagram. For more information, see What Are Variants and When to Use Them.

There are two types of variants, hierarchical and inline. Hierarchical variants are through Variant Subsystem blocks, whereas Inline Variants are through Variant Source and Variant Sink blocks. Use of a Variant Subsystem block provides these advantages:

  • Allows you to mix Model and Subsystem blocks as variant systems

  • Supports flexible I/O, so that all variants do not need to have the same number of input and output ports

Blocks

Variant Subsystem, Variant ModelTemplate subsystem containing Subsystem, Model, or Subsystem Reference blocks as variant choices
Variant SourceRoute among multiple inputs using variants
Variant SinkRoute amongst multiple outputs using variants
Manual Variant SourceSwitch between multiple variant choices at input
Manual Variant SinkSwitch between multiple variant choices at output

Classes

Simulink.VariantSpecify conditions that control variant selection
Simulink.VariantConfigurationDataClass representing a variant configurations data object
Simulink.VariantControlCreate a variant control variable object
Simulink.VariantVariableCreate a variant parameter object
Simulink.VariantManagerAccess Variant Manager functionality programmatically
Simulink.VariantConfigurationAnalysisAnalyze variant configurations programmatically

Topics

Introduction to Variants

Variant Subsystem

Inline Variants

Code Generation

Variant Manager

Variant Parameters

Example Models