Main Content

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

getReporter

クラス: slreportgen.finder.ModelVariableResult
名前空間: slreportgen.finder

モデル変数検索の結果のレポーターを取得する

R2019b 以降

構文

reporter = getReporter(variableResult)

説明

reporter = getReporter(variableResult) は、モデル変数検索の結果の slreportgen.report.ModelVariable オブジェクトを返します。

入力引数

すべて展開する

slreportgen.finder.ModelVariableFinder オブジェクトの find または next メソッドを使用した検索の結果。

出力引数

すべて展開する

モデル変数についての情報をレポートに含めるレポーター。レポーターのプロパティを設定することで、変数の情報の内容と書式設定をカスタマイズします。

すべて展開する

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

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

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 で導入