メインコンテンツ

getChoices

バリアント コンポーネントの使用可能な選択肢を取得

説明

compList = getChoices(variantComponent) は、バリアント コンポーネントで使用できる選択肢のリストを返します。

すべて折りたたむ

モデルを作成してルート アーキテクチャを取得し、バリアント コンポーネントを 1 つ作成してバリアント コンポーネントの選択肢を 2 つ追加し、最初の選択肢を取得します。

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: ''

入力引数

すべて折りたたむ

バリアント コンポーネント。systemcomposer.arch.VariantComponent オブジェクトとして指定します。

出力引数

すべて折りたたむ

バリアント コンポーネントで使用できる選択肢。systemcomposer.arch.Component オブジェクトの配列として返されます。

詳細

すべて折りたたむ

バージョン履歴

R2019a で導入