メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

getAllParameters

関連付けられた coder.descriptor.LookupTableDataInterface オブジェクトと coder.descriptor.BreakpointDataInterface オブジェクトをすべて返す

構文

dataInterface = getAllParameters(parameterObj)

説明

dataInterface = getAllParameters(parameterObj) は、関連付けられた coder.descriptor.LookupTableDataInterface オブジェクトと coder.descriptor.BreakpointDataInterface オブジェクトをすべて返します。

入力引数

すべて展開する

モデルの Lookup Table ブロックを表す coder.descriptor.LookupTableDataInterface オブジェクト。

データ型: string

出力引数

すべて展開する

coder.descriptor.LookupTableDataInterface オブジェクトは、モデルの Lookup Table ブロックを表します。coder.descriptor.BreakpointDataInterface オブジェクトは、Lookup Table ブロックに関連付けられているブレークポイント セット データを表します。

すべて展開する

この例では、モデルからルックアップ テーブル データ インターフェイス オブジェクトとブレークポイント データ インターフェイス オブジェクトをすべて取得する方法を説明します。

モデルの作成

ルックアップ テーブル ブロックを含むモデルを開いて、ビルドします。

open_system('ASAP2Demo');
slbuild('ASAP2Demo');
### Searching for referenced models in model 'ASAP2Demo'.
### Total of 2 models to build.
### Starting serial code generation build.
### Successfully updated the model reference code generation target for: ASAP2DemoModelRef
### Starting build procedure for: ASAP2Demo
### Successful completion of build procedure for: ASAP2Demo

Build Summary

Model reference code generation targets:

Model              Build Reason                                 Status                        Build Duration
============================================================================================================
ASAP2DemoModelRef  Target (ASAP2DemoModelRef.c) did not exist.  Code generated and compiled.  0h 0m 6.3165s 

Top model targets:

Model      Build Reason                                         Status                        Build Duration
============================================================================================================
ASAP2Demo  Information cache folder or artifacts were missing.  Code generated and compiled.  0h 0m 13.612s 

2 of 2 models built (0 models already up to date)
Build duration: 0h 0m 20.959s

モデルのコード記述子オブジェクトを作成します。

codeDescObj = coder.getCodeDescriptor('ASAP2Demo');

ルックアップ テーブルのパラメーターのプロパティを返します。

params = getDataInterfaces(codeDescObj,'Parameters');

変数 params は、coder.descriptor.DataInterface オブジェクトと coder.descriptor.LookupTableDataInterface オブジェクトからなる配列です。

配列内の 6 番目の位置にアクセスしてモデルの Lookup Table ブロックの詳細を取得します。

parameterObj = params(6)
parameterObj = 
  LookupTableDataInterface with properties:
                       Type: [1×1 coder.descriptor.types.Type]
                        SID: 'ASAP2Demo:12'
              GraphicalName: 'tabledata'
                VariantInfo: [1×0 coder.descriptor.VariantInfo]
             Implementation: [1×1 coder.descriptor.DataImplementation]
                     Timing: [1×0 coder.descriptor.TimingInterface]
                       Unit: 'rpm'
                      Range: [1×1 coder.descriptor.Range]
         SupportTunableSize: 0
    BreakpointSpecification: 'Explicit values'
                     Output: [1×1 coder.descriptor.DataInterface]
                Breakpoints: [1×2 coder.descriptor.BreakpointDataInterface Sequence]

関連付けられているすべての coder.descriptor.LookupTableDataInterface オブジェクトと coder.descriptor.BreakpointDataInterface オブジェクトを取得します。

dataInterface = getAllParameters(parameterObj)
dataInterface = 
  1×3 heterogeneous DataInterface (LookupTableDataInterface, BreakpointDataInterface) array with properties:

    Type
    SID
    GraphicalName
    VariantInfo
    Implementation
    Timing
    Unit
    Range

バージョン履歴

R2020a で導入