Main Content

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

getAllParameters

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

R2020a 以降

構文

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');
rtwbuild('ASAP2Demo');
### Starting serial model reference 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

Code generation targets built:

Model              Action                        Rebuild Reason                       
======================================================================================
ASAP2DemoModelRef  Code generated and compiled.  ASAP2DemoModelRef.c does not exist.  

Top model targets built:

Model      Action                        Rebuild Reason                                    
===========================================================================================
ASAP2Demo  Code generated and compiled.  Code generation information file does not exist.  

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

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

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: [1x1 coder.descriptor.types.Type]
                        SID: 'ASAP2Demo:12'
              GraphicalName: 'tabledata'
                VariantInfo: [1x0 coder.descriptor.VariantInfo]
             Implementation: [1x1 coder.descriptor.DataImplementation]
                     Timing: [1x0 coder.descriptor.TimingInterface]
                       Unit: 'rpm'
                      Range: [1x1 coder.descriptor.Range]
         SupportTunableSize: 0
    BreakpointSpecification: 'Explicit values'
                     Output: [1x1 coder.descriptor.DataInterface]
                Breakpoints: [1x2 coder.descriptor.BreakpointDataInterface Sequence]

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

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

    Type
    SID
    GraphicalName
    VariantInfo
    Implementation
    Timing
    Unit
    Range

バージョン履歴

R2020a で導入