Contenuto principale

getChoices

Get available choices in variant component

Description

compList = getChoices(variantComponent) returns the list of choices available for a variant component.

example

Examples

collapse all

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 135 115]
                  Model: [1×1 systemcomposer.arch.Model]
         SimulinkHandle: 216.0255
    SimulinkModelHandle: 149.0524
                   UUID: 'eca3bc77-1558-44df-90b4-13a0f0bbbf16'
            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

Version History

Introduced in R2019a