Main Content

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

isBreakpointDataInterface

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

R2020a 以降

構文

breakpointTableDataInterface = isBreakpointDataInterface(parameterObj)

説明

breakpointTableDataInterface = isBreakpointDataInterface(parameterObj) は、オブジェクトが coder.descriptor.BreakpointDataInterface (Embedded Coder) オブジェクトかどうかを示す logical 値を返します。

入力引数

すべて展開する

モデルのブレークポイント セットを表す coder.descriptor.BreakpointDataInterface オブジェクト。

データ型: string

出力引数

すべて展開する

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

データ型: logical

すべて展開する

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

モデルの作成

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

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

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

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

codeDescObj = coder.getCodeDescriptor('ASAP2Demo');

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

params = getDataInterfaces(codeDescObj,'Parameters');

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

配列の最初の位置にアクセスして、モデルの Lookup Table ブロックに接続されたブレークポイント セットの詳細を取得します。

parameterObj = params(6).Breakpoints(1);

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

breakpointDataInterface = isBreakpointDataInterface(parameterObj)
breakpointDataInterface = logical
   1

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

バージョン履歴

R2020a で導入