slreportgen.finder.ModelVariableResult クラス
パッケージ: slreportgen.finder
スーパークラス: mlreportgen.finder.Result
説明
Simulink® モデルまたはサブシステムで使用されているモデル変数の検索結果オブジェクト。
slreportgen.finder.ModelVariableResult
クラスは handle
クラスです。
作成
slreportgen.finder.ModelVariableResult
オブジェクトは、明示的に作成しません。slreportgen.finder.ModelVariableFinder
の find
または next
メソッドは、検出した変数ごとに slreportgen.finder.ModelVariableResult
オブジェクトを作成します。
プロパティ
Object
— Simulink.VariableUsage
オブジェクト
Simulink.VariableUsage
オブジェクト
この結果によって表される変数の Simulink.VariableUsage
オブジェクト。このプロパティは読み取り専用です。
Name
— 変数名
文字ベクトル
この結果によって表される変数の名前。文字ベクトルとして指定します。このプロパティは読み取り専用です。
Source
— 変数定義のソース
文字ベクトル
変数定義のソース。文字ベクトルとして指定します。このプロパティは読み取り専用です。次の表は、値の例を示しています。
値 | 説明 |
---|---|
'base workspace' | MATLAB® ベース ワークスペース |
'MyModel' | MyModel のモデル ワークスペース |
'MyModel/Mask1' | マスク ブロックのマスク ワークスペース |
'my_data_dictionary.sldd' | データ ディクショナリ |
SourceType
— 定義元のワークスペースのタイプ
文字ベクトル
変数を定義するワークスペースのタイプ。次のいずれかの文字ベクトルで指定します。
'base workspace'
'model workspace'
'mask workspace'
'data dictionary'
このプロパティは読み取り専用です。
Users
— 変数を使用するブロック
cell 配列
変数を使用するブロック。文字ベクトルの cell 配列で指定します。このプロパティは読み取り専用です。
ModelBlockPath
— 変数値を設定する Model ブロックのパス
文字ベクトル
変数値を設定する Model ブロックのパス。文字ベクトルとして指定します。このプロパティは読み取り専用です。
参照モデルがモデル引数を使用してブロック パラメーター値を設定するとします。モデルに参照モデルの複数のインスタンスがある場合、モデル変数ファインダーは、モデル引数に関連付けられている変数の複数のインスタンスを返します。ModelBlockPath
プロパティは、その値を設定する Model ブロックへのパスを提供することにより、変数のインスタンスを一意に特定します。変数が参照モデル内のモデル引数に関連付けられていない場合、ModelBlockPath
は空です。参照モデルとインスタンス固有のパラメーターの詳細については、再利用可能な参照モデルのインスタンスのパラメーター化を参照してください。
Tag
— 追加情報
文字列 | 文字ベクトル | 数値 | ...
この結果と共に保存する追加情報。任意の型の値に設定できます。
メソッド
パブリック メソッド
getReporter | モデル変数検索の結果のレポーターを取得する |
getVariableID | Get unique ID of model variable |
getVariableValue | モデル変数検索の結果から変数の値を取得する |
getDefaultSummaryProperties | Get list of default summary table properties for a finder result class |
getDefaultSummaryTableTitle | ファインダー結果クラスの既定の概要テーブル タイトルを取得する |
getPropertyValues | Get property values of model variable and model variable finder result objects |
getReporterLinkTargetID | Get link target ID of reporter object associated with the finder result object |
例
レポートにおけるモデル変数の書式設定のカスタマイズ
検索結果を反復処理し、結果ごとにモデル変数レポーターのプロパティを設定することで、レポートにおけるモデル変数の書式設定をカスタマイズします。
% 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 で導入
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)