Main Content

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

slreportgen.finder.ModelVariableResult クラス

名前空間: slreportgen.finder
スーパークラス: mlreportgen.finder.Result

モデル変数の検索結果オブジェクト

R2019b 以降

説明

Simulink® モデルまたはサブシステムで使用されているモデル変数の検索結果オブジェクト。

slreportgen.finder.ModelVariableResult クラスは handle クラスです。

クラス属性

HandleCompatible
true

クラス属性の詳細については、クラスの属性を参照してください。

作成

slreportgen.finder.ModelVariableResult オブジェクトは、明示的に作成しません。slreportgen.finder.ModelVariableFinderfind または next メソッドは、検出した変数ごとに slreportgen.finder.ModelVariableResult オブジェクトを作成します。

プロパティ

すべて展開する

パブリック プロパティ

この結果に加える追加のユーザー定義情報。任意の値として指定します。

属性:

NonCopyable
true

データ型: any

保護プロパティ

この結果によって表される変数の Simulink.VariableUsage オブジェクト。

属性:

SetAccess
protected

この結果によって表される変数の名前。string スカラーとして指定します。

属性:

SetAccess
protected

変数定義のソース。string スカラーとして指定します。次の表は、値の例を示しています。

説明
"base workspace"MATLAB® ベース ワークスペース。
"MyModel"MyModel のモデル ワークスペース。
"MyModel/Mask1"マスク ブロックのマスク ワークスペース。
"my_data_dictionary.sldd"データ ディクショナリ my_data_dictionary.sldd

属性:

SetAccess
protected

変数を定義するワークスペースのタイプ。次のいずれかの string スカラーで指定します。

  • "base workspace"

  • "model workspace"

  • "mask workspace"

  • "data dictionary"

このプロパティは読み取り専用です。

属性:

SetAccess
protected

変数を使用するブロック。string スカラーの cell 配列で指定します。

属性:

SetAccess
protected

変数値を設定する Model ブロックのパス。string スカラーとして指定します。

参照モデルがモデル引数を使用してブロック パラメーター値を設定するとします。モデルに参照モデルの複数のインスタンスがある場合、モデル変数ファインダーは、モデル引数に関連付けられている変数の複数のインスタンスを返します。ModelBlockPath プロパティは、その値を設定する Model ブロックへのパスを提供することにより、変数のインスタンスを一意に特定します。変数が参照モデル内のモデル引数に関連付けられていない場合、ModelBlockPath は空です。参照モデルとインスタンス固有のパラメーターの詳細については、再利用可能な参照モデルのインスタンスのパラメーター化を参照してください。

属性:

SetAccess
protected

メソッド

すべて展開する

すべて折りたたむ

検索結果を反復処理し、結果ごとにモデル変数レポーターのプロパティを設定することで、レポートにおけるモデル変数の書式設定をカスタマイズします。

次のコマンドを実行して、この例で使用するサポート ファイルにアクセスします。

openExample('rptgenext/SimulinkReportGeneratorFilesExample');
% Create a Report
rpt = slreportgen.report.Report("MyReport","pdf");

% Create a Chapter
chapter = mlreportgen.report.Chapter();
chapter.Title = "Model Variable Reporter Example";

% Load the model
model_name = "slrgex_sf_car";
load_system(model_name);

% Find the variables in the model
finder = slreportgen.finder.ModelVariableFinder(model_name);

while hasNext(finder)
    result = next(finder);
    
    % Get the ModelVariable reporter for the result
    % Customize the formatting of numbers
    reporter = getReporter(result);
    reporter.NumericFormat = "%.4f";
    
    % Add the reporter to the chapter
    add(chapter,reporter);
end
% Add chapter to the report
add(rpt,chapter);

% Close the report and open the viewer
close(rpt);
rptview(rpt);

バージョン履歴

R2019b で導入