setActiveChoice - Set active choice on variant component - MATLAB (original) (raw)
Main Content
Set active choice on variant component
Syntax
Description
setActiveChoice([variantComponent](#mw%5F45e9c220-2264-4242-b00d-f9a9256e9f20%5Fsep%5Fmw%5Fdc134891-6ed2-4ed7-8511-0d8e13eb5044),[choice](#mw%5F827b8e57-e42d-4e1d-9cd1-3125b034d7cd))
sets the active choice on the variant component.
Examples
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"); systemcomposer.openModel("archModel"); arch = get(model,"Architecture"); variant = addVariantComponent(arch,"Component1"); compList = addChoice(variant,["Choice1","Choice2"]); setActiveChoice(variant,compList(2));
Input Arguments
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
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 programmatically to control which variant is active. | Set Variant Control Condition |
Version History
Introduced in R2019a
See Also
Blocks
Objects
Functions
- addChoice | addVariantComponent | getActiveChoice | getChoices | getCondition | makeVariant | makeVariantAssembly | setCondition | updatePortsFromChoices