Documentation

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.

Note

For new models, use a Model block for model variants only if you need to use variants that are conditionally executed models (models with control ports). Model variants are supported for backward compatibility. However, support for model variants will be removed in a future release. 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

To convert a Model block that contains variant models to a Variant Subsystem block that contains Model blocks that reference the variant models, right-click the Model block and select Subsystems & Model Reference > Convert to > Variant Subsystem. The converted model produces the same results as the original model.

Blocks

Variant SubsystemTemplate subsystem containing Subsystem blocks as variant choices
Variant ModelTemplate subsystem containing Subsystem blocks as variant choices
Variant SourceRoute amongst multiple inputs using variants
Variant SinkRoute amongst multiple outputs using variants
Manual Variant SourceSwitch amongst multiple variant choices at input
Manual Variant SinkSwitch amongst multiple variant choices at output
Model VariantsInclude multiple model implementations as block in another model

Classes

Simulink.VariantSpecify conditions that control variant selection
Simulink.VariantConfigurationDataClass representing a variant configurations data object
Simulink.VariantManagerClass representing a set of Variant Manager functionality

Topics

Introduction to Variants

What Are Variants and When to Use Them

Single system that caters to multiple variant requirements.

Create a Simple Variant Model

Lean how to create a model using Variant blocks.

Introduction to Variant Controls

Learn how to control variant blocks.

Working with Variant Choices

Activate, inactivate, or create default variant choices.

Create Variant Controls Programmatically

Use MATLAB® code to define variant controls.

Variant Subsystem

Variant Subsystems

Basic functioning of Variant Subsystems

Define, Configure, and Activate Variants

Represent variant choices in Variant Subsystems.

Condition Propagation with Variant Subsystem

Propagate variant conditions outside of Variant Subsystem block.

Inline Variants

Define and Configure Variant Sources and Sinks

Represent variant choices using Inline Variants.

Visualize Variant Implementations in a Single Layer

View the variant choices in a model containing Inline Variants.

Variant Source and Variant Sink Blocks

Define variant choice in Variant Source and Sink.

Variant Condition Propagation with Variant Sources and Sinks

Propagate variant conditions from the Inline Variants block.

Propagating Variant Conditions to Subsystems

Understand variant condition propagation to virtual and non-virtual subsystems.

Propagate Variant Condition to Conditional Subsystem

Learn about variant condition propagation with conditional subsystem.

Control Variant Condition Propagation

Control propagation of variant conditions upstream and downstream.

Model Reference Variants

Model Reference Variants

Basics of Model Reference variants

Set up Model Variants Using a Model Block

Configure, disable, and parameterize Model Variants.

Code Generation

Prepare Variant-Containing Model for Code Generation

Configure and generate code for a variant model.

Variant Manager

Variant Manager Overview

Use a central tool to manage variation points of a variants model.

Create and Validate Variant Configurations

Create variant configuration for a model and validate their accuracy.

Import Control Variables to Variant Configuration

Import control variables associated with a model.

Define Constraints

Define constraints across models.

Reduce Models Containing Variant Blocks

Generate models with a subset of variant configurations.

Example Models

Variants Example Models

A set of concept examples that illustrate some of the Simulink variants capabilities.

Was this topic helpful?