このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
slreportgen.finder.FunctionReferenceFinder クラス
パッケージ: slreportgen.finder
スーパークラス: mlreportgen.finder.Finder
説明
クラス slreportgen.finder.FunctionReferenceFinder
のオブジェクトを使用して、特に Simulink® ブロック内のパラメーターの計算に使用される関数参照を検索します。
slreportgen.finder.FunctionReferenceFinder
クラスは handle
クラスです。
作成
プロパティ
Container
— 関数参照を検索する Simulink モデルまたはブロック
文字配列 | string スカラー | slreportgen.finder.DiagramResult
オブジェクト | slreportgen.finder.BlockResult
オブジェクト | モデル ハンドル | ブロック ハンドル
関数参照を検索する Simulink モデルまたはブロック。次の値のいずれかとして指定します。
値 | 説明 |
---|---|
モデル名 | モデル名。string スカラーまたは文字ベクトルとして指定します。例: "slrgex_sf_car" |
ブロックへのパス | ブロックへのパス。string スカラーまたは文字ベクトルとして指定します。例: "slrgex_sf_car/Engine" |
モデル ハンドル | モデル ハンドル。関数 slreportgen.utils.getModelHandle によって生成されます。例: slreportgen.utils.getModelHandle("slrgex_sf_car") |
ブロック ハンドル | ブロック ハンドル。関数 getSimulinkBlockHandle によって生成されます。例: getSimulinkBlockHandle("slrgex_sf_car/Engine") |
slreportgen.finder.DiagramResult オブジェクト | Simulink モデルまたはサブシステムを表す検索結果オブジェクト |
slreportgen.finder.BlockResult オブジェクト | Simulink ブロックを表す検索結果オブジェクト |
SearchDepth
— コンテナー内を検索するレベルの数
inf
(既定値) | 非負の整数
コンテナー内を検索するレベルの数。非負の整数または inf
(検索する深さを無制限にする場合) として指定します。
属性:
GetAccess | public |
SetAccess | public |
FunctionType
— 検索する関数のタイプ
"all"
(既定値) | "built-in"
| "user-defined"
検索する関数のタイプ。次の値のいずれかとして指定します。
値 | 説明 |
---|---|
"all" | すべての関数参照の検索 |
"built-in" | 組み込み関数参照の検索 |
"user-defined" | ユーザー定義関数参照の検索 |
属性:
GetAccess | public |
SetAccess | public |
データ型: string
| char
SearchReferencedModels
— 参照モデル内を検索するかどうか
true
または 1
(既定値) | false
または 0
Container
プロパティによって表されるモデルまたはブロックが参照するモデル内を検索するかどうか。logical 1
(true
) または 0
(false
) として指定します。SearchReferencedModels
が true の場合、次のようになります。
ファインダーは、検索の深さ内にある参照モデルのみを検索します。
ファインダーは、参照モデルを含むブロックの深さに関係なく、
SearchDepth
で指定された深さまで参照モデルを検索します。ファインダーは、参照モデルが参照するモデルを検索します。
属性:
GetAccess | public |
SetAccess | public |
データ型: logical
LookUnderMasks
— マスク内を検索するかどうか
true
または 1
(既定値) | false
または 0
マスク内を検索するかどうか。logical 1
(true
) または 0
(false
) として指定します。
属性:
GetAccess | public |
SetAccess | public |
データ型: logical
FollowLibraryLinks
— ライブラリ ブロックまでリンクをたどるかどうか
true
または 1
(既定値) | false
または 0
ライブラリ ブロックまでリンクをたどるかどうか。logical 1
(true
) または 0
(false
) として指定します。
属性:
GetAccess | public |
SetAccess | public |
データ型: logical
IncludeInactiveVariants
— 非アクティブなバリアントが参照する関数を検索するかどうか
false
または 0
(既定値) | true
または 1
バリアント サブシステムおよびモデル バリアント内の非アクティブなバリアントが参照する関数を検索するかどうか。logical 0
(false
) または 1
(true
) として指定します。
属性:
GetAccess | public |
SetAccess | public |
データ型: logical
Properties
— 検索対象とする関数のプロパティ
cell 配列
検索対象とする関数のプロパティ。{"Name","Value"}
という形式で、名前と値のペアの cell 配列として指定します。ファインダーは、指定のプロパティが指定の値をもつ関数のみを返します。サポートされるプロパティには、slreportgen.finder.FunctionReferenceResult
クラスのプロパティが含まれます。
データ型: cell
メソッド
パブリック メソッド
find |
|
hasNext |
|
next |
|
例
Simulink ブロック内の MATLAB 関数参照に関するレポート
この例では、Simulink ブロック内の MATLAB 関数参照を検索してレポートする方法を説明します。
長い完全修飾クラス名を使用せずに済むよう、次のパッケージをインポートします。
import slreportgen.report.* import slreportgen.finder.*
PDF タイプの slreportgen.report.Report
を作成します。
theReport = Report("FunctionReferenceReport","pdf");
モデル slrgex_fuelsys
を開き、ファインダーが最新バージョンのモデルを検索するようにモデルをコンパイルします。
modelName = "slrgex_fuelsys";
open_system(modelName);
slreportgen.utils.compileModel(modelName);
slreportgen.finder.FunctionReferenceFinder
オブジェクトを作成します。
funcRefFinder = FunctionReferenceFinder(modelName);
参照モデル内を検索するようにファインダーを設定します。
funcRefFinder.SearchReferencedModels = true;
メソッド hasNext
および next
を反復して使用し、slreportgen.finder.FunctionReferenceResult
オブジェクトを一度に 1 つずつ取得します。
while(hasNext(funcRefFinder))
nextRes = next(funcRefFinder);
参照関数が組み込み関数の場合は、結果をレポートに直接追加します。
if(nextRes.FunctionType == "built-in") append(theReport,nextRes);
参照関数が user-defined
関数の場合は、この結果の slreportgen.report.FunctionReference
レポーターのハンドルを取得します。レポーターの ShowReferencesTable
プロパティを false
に設定することで、参照テーブルを除外するようにレポーターをカスタマイズします。次に、レポーターをレポートに追加します。
else reporter = getReporter(nextRes); reporter.ShowReferencesTable = false; append(theReport,reporter); end end
モデルのコンパイルを解除して閉じます。
slreportgen.utils.uncompileModel(modelName) close_system(modelName);
レポートを閉じて表示します。
close(theReport); rptview(theReport);
バージョン履歴
R2022a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)