Main Content


Set active choice on variant component



setActiveChoice(variantComponent,choice) sets the active choice on the variant component.


collapse all

Create a model, get the root architecture, create one variant component, add two choices for the variant component, and set the active choice.

model = systemcomposer.createModel("archModel");
arch = get(model,"Architecture");
variant = addVariantComponent(arch,"Component1");
compList = addChoice(variant,["Choice1","Choice2"]);

Input Arguments

collapse all

Variant component, specified as a systemcomposer.arch.VariantComponent object.

Active choice in a variant component, specified as a systemcomposer.arch.Component object or label of the variant choice as a character vector or string.

Example: "Choice2"

Data Types: char | string

More About

collapse all


TermDefinitionApplicationMore Information

A variant is one of many structural or behavioral choices in a variant component.

Use variants to quickly swap different architectural designs for a component while performing analysis.

Create Variants
variant control

A variant control is a string that controls the active variant choice.

Set the variant control programmatically to control which variant is active.

Set Variant Control Condition

Version History

Introduced in R2019a