getChoices
Get available choices in variant component
Description
returns the list of choices available for a variant component.compList
= getChoices(variantComponent
)
Examples
Get First Variant Choice
Create a model, get the root architecture, create a one variant component, add two choices for the variant component, and get the first choice.
model = systemcomposer.createModel("archModel",true); arch = get(model,"Architecture"); variant = addVariantComponent(arch,"Component1"); compList = addChoice(variant,["Choice1","Choice2"]); choices = getChoices(variant); variantChoice = choices(1)
variantChoice = Component with properties: IsAdapterComponent: 0 Architecture: [1x1 systemcomposer.arch.Architecture] Name: 'Choice1' Parent: [1x1 systemcomposer.arch.Architecture] Ports: [0x0 systemcomposer.arch.ComponentPort] OwnedPorts: [0x0 systemcomposer.arch.ComponentPort] OwnedArchitecture: [1x1 systemcomposer.arch.Architecture] Parameters: [0x0 systemcomposer.arch.Parameter] Position: [15 15 65 76] Model: [1x1 systemcomposer.arch.Model] SimulinkHandle: 215.0011 SimulinkModelHandle: 9.7656e-04 UUID: 'b298f639-2db2-4bc9-910a-6e848de8ab91' ExternalUID: ''
Input Arguments
variantComponent
— Variant component
variant component object
Variant component, specified as a systemcomposer.arch.VariantComponent
object.
Output Arguments
compList
— Choices available for variant component
array of component objects
Choices available for variant component, returned as an array of systemcomposer.arch.Component
objects.
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
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
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)