Main Content

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

isLookupTableDataInterface

オブジェクトが coder.descriptor.LookupTableDataInterface オブジェクトかどうか確認する

R2020a 以降

構文

lookupTableDataInterface = isLookupTableDataInterface(parameterObj)

説明

lookupTableDataInterface = isLookupTableDataInterface(parameterObj) は、オブジェクトが coder.descriptor.LookupTableDataInterface オブジェクトかどうかを示す logical 値を返します。

入力引数

すべて展開する

モデルのルックアップ テーブル ブロックを表す coder.descriptor.LookupTableDataInterface オブジェクト。

データ型: string

出力引数

すべて展開する

オブジェクトが coder.descriptor.LookupTableDataInterface かどうかを示す logical 値。

データ型: logical

すべて展開する

この例では、オブジェクトが coder.descriptor.LookupTableDataInterface オブジェクトであるかどうかを判別する方法を説明します。

モデルの作成

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

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 31.714s

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

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

codeDescObj = coder.getCodeDescriptor('ASAP2Demo');

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

params = getDataInterfaces(codeDescObj,'Parameters');

変数 params は、coder.descriptor.DataInterface オブジェクトと coder.descriptor.LookupTableDataInterface オブジェクトからなる配列です。モデル ASAP2Demo には 3 つのルックアップ テーブル ブロックが含まれています。調整可能なブレークポイント セット データがあるのはそれらのうち 2 つだけです。コード ジェネレーターは、対応する 2 つの coder.descriptor.LookupTableDataInterface オブジェクトのみを作成します。

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

parameterObj = params(6);

変数 parameterObj に保存されているオブジェクトが coder.descriptor.LookupTableDataInterface オブジェクトかどうかを確認します。

lookupTableDataInterface = isLookupTableDataInterface(parameterObj)
lookupTableDataInterface = logical
   1

コード ジェネレーターは、parameterObjcoder.descriptor.LookupTableDataInterface オブジェクトである場合、logical 値 1 を返します。それ以外の場合は、logical 値 0 を返します。

バージョン履歴

R2020a で導入