getChoices - Get available choices in variant component - MATLAB (original) (raw)

Main Content

Get available choices in variant component

collapse all in page

Syntax

[compList = getChoices(variantComponent)](#d126e102909)

Description

[compList](#mw%5Fc51e1072-ef87-41f8-90e5-b19ab435bdf6) = getChoices([variantComponent](#mw%5Fd1148e0d-eb46-481a-b4be-107a1cb9c934%5Fsep%5Fmw%5Fdc134891-6ed2-4ed7-8511-0d8e13eb5044)) returns the list of choices available for a variant component.

example

Examples

collapse all

Open Live Script

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"); systemcomposer.openModel("archModel"); 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: [1×1 systemcomposer.arch.Architecture]
               Name: 'Choice1'
             Parent: [1×1 systemcomposer.arch.Architecture]
              Ports: [0×0 systemcomposer.arch.ComponentPort]
         OwnedPorts: [0×0 systemcomposer.arch.ComponentPort]
  OwnedArchitecture: [1×1 systemcomposer.arch.Architecture]
         Parameters: [0×0 systemcomposer.arch.Parameter]
           Position: [15 15 65 76]
              Model: [1×1 systemcomposer.arch.Model]
     SimulinkHandle: 220.0009
SimulinkModelHandle: 153.0004
               UUID: 'a1ae59ce-bd11-4cf4-a35f-20365a27306e'
        ExternalUID: ''

Input Arguments

collapse all

Variant component, specified as a systemcomposer.arch.VariantComponent object.

Output Arguments

collapse all

Choices available for variant component, returned as an array of systemcomposer.arch.Component objects.

More About

collapse all

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

Topics