Manage Variant Modeling Components - MATLAB & Simulink (original) (raw)

Manage variant elements and define, reduce, and analyze variant configurations

Variant Manager is a tool that allows you to visualize the model hierarchy and centrally manage the usage of variant elements such as variant blocks and variant transitions in Stateflow® charts across the hierarchy.

The tool is available as a support package named Variant Manager for Simulink® with these main capabilities:

Classes

Simulink.VariantConfigurationAnalysis Analyze variant configurations programmatically

Objects

Simulink.VariantConfigurationData Create and store variant configurations and constraints

Functions

expand all

Simulink.VariantManager.activateModel Validate and activate variant blocks in model hierarchy (Since R2022b)
Simulink.VariantManager.updateModel Obtain model compilation information and activate variant blocks in model hierarchy (Since R2024b)
Simulink.VariantManager.applyConfiguration Apply specified variant configuration to model (Since R2022b)
Simulink.VariantManager.findVariantControlVars Find variables used in variant control expressions
Simulink.VariantManager.generateConfigurations Generate variant configurations automatically (Since R2022b)
Simulink.VariantManager.getConfigurationData Get variant configuration data object associated with model (Since R2022b)
Simulink.VariantManager.getPreferredConfigurationName Get name of preferred variant configuration for model (Since R2022b)
Simulink.VariantManager.reduceModel Generate reduced model for specified variant configurations
Simulink.VariantManager.validateConstraint Verify if variant constraint is satisfied by model hierarchy (Since R2025a)

Variant Configurations

addConfiguration Add new variant configuration to variant configuration data object
addCopyOfConfiguration Add copy of existing variant configuration to variant configuration data object
getConfiguration Get specific variant configuration from variant configuration data object
removeConfiguration Remove variant configuration from variant configuration data object
addControlVariables Add variant control variables to named variant configuration in variant configuration data object
removeControlVariable Remove variant control variable from variant configuration
addConstraint Add constraint to variant configuration data object
removeConstraint Remove constraint from variant configuration data object
isConfigActive Check if variant configuration is active (Since R2025a)

Component Configurations

addComponentConfiguration Associate top-model variant configuration with variant configuration of referenced model (Since R2022b)
getComponentConfigurationName Get name of variant configuration used by referenced component in model hierarchy (Since R2023b)
removeComponentConfiguration Remove association between variant configurations of top-level model and referenced model (Since R2022b)

Preferred Configuration

setPreferredConfiguration Set name of preferred variant configuration for variant configuration data object (Since R2022b)
getPreferredConfiguration Get name of preferred variant configuration for variant configuration data object (Since R2022b)
convertDefaultToPreferred Convert default variant configuration to preferred variant configuration (Since R2022b)

Support Package

Variant Manager for Simulink

Use a central tool to manage all variation points in a variant model.

Topics

Manage, Configure, Reduce, and Analyze System Variants with Variant Manager for Simulink

Gives an overview of the capabilities of the Variant Manager tool in Simulink.

Reduce Model Containing Variant Blocks

Reduce Model Containing Variant Blocks

Reduce a Simulink® model that contains variant blocks both programmatically and by using Variant Reducer in Variant Manager.

Reduce Model Containing Variant Parameters

Reduce Model Containing Variant Parameters

Reduce a Simulink® model that contains variant parameters using Variant Reducer in Variant Manager. The example explains the reduction process for these scenarios:

Reduce Models Containing Referenced Subsystems

Reduce Models Containing Referenced Subsystems

Reduce a Simulink® model that contains Subsystem Reference blocks.

Run Simulations for Variant Models Using Variant Configurations

Run Simulations for Variant Models Using Variant Configurations

Run single or multiple simulations for a variant model using variant configurations.

Run Tests for Variant Models Using Variant Configurations

Run Tests for Variant Models Using Variant Configurations

Run tests for a variant model using variant configurations.