addChoice - Add variant choices to variant component - MATLAB (original) (raw)
Main Content
Add variant choices to variant component
Syntax
Description
[compList](#mw%5F2ce70d90-1531-4c39-bb67-7ada7fa584a0) = addChoice([variantComponent](#mw%5Fcfbf9237-ca94-4784-83e6-356f514446cc%5Fsep%5Fmw%5Fdc134891-6ed2-4ed7-8511-0d8e13eb5044),[choices](#mw%5F7625813b-c3b6-47a6-9c37-526fa5975f22))
creates variant choices specified in choices
in the specified variant component and returns their handles.
[compList](#mw%5F2ce70d90-1531-4c39-bb67-7ada7fa584a0) = addChoice([variantComponent](#mw%5Fcfbf9237-ca94-4784-83e6-356f514446cc%5Fsep%5Fmw%5Fdc134891-6ed2-4ed7-8511-0d8e13eb5044),[choices](#mw%5F7625813b-c3b6-47a6-9c37-526fa5975f22),[labels](#mw%5Fc27e7d57-f5bd-48e2-bbb4-cbbb67f35f36))
creates variant choices specified in choices
with labelslabels
in the specified variant component and returns their handles.
Examples
Create a model, get the root architecture, create one variant component, and add two choices for the variant component.
model = systemcomposer.createModel("archModel"); systemcomposer.openModel("archModel"); arch = get(model,"Architecture"); variant = addVariantComponent(arch,"Component1"); compList = addChoice(variant,["Choice1","Choice2"]);
Input Arguments
Variant choice names, specified as a cell array of character vectors or an array of strings. The length of choices
must be the same aslabels.
Data Types: char
| string
Variant choice labels, specified as a cell array of character vectors or an array of strings. The length of labels
must be the same aschoices.
Data Types: char
| string
Output Arguments
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
- addVariantComponent | getActiveChoice | getChoices | getCondition | makeVariant | makeVariantAssembly | setActiveChoice | setCondition | updatePortsFromChoices