setActiveChoice
Description
setActiveChoice(
sets the active choice on the variant component.variantComponent
,choice
)
Examples
Set Active Variant Choice
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",true); arch = get(model,"Architecture"); variant = addVariantComponent(arch,"Component1"); compList = addChoice(variant,["Choice1","Choice2"]); setActiveChoice(variant,compList(2));
Input Arguments
variantComponent
— Variant component
variant component object
Variant component, specified as a systemcomposer.arch.VariantComponent
object.
choice
— Active choice in a variant component
component object | character vector | string
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
Definitions
Term | Definition | Application | More Information |
---|---|---|---|
variant | 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 to programmatically control which variant is active. | Set Variant Control Condition |
Version History
Introduced in R2019a
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)