Main Content

setActiveChoice

Set active choice on variant component

Description

example

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

Examples

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'});
setActiveChoice(variant,compList(2));

Input Arguments

collapse all

Architecture component, specified as a systemcomposer.arch.VariantComponent object with multiple choices.

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

Introduced in R2019a