Time
コード セクションの実行時間の測定を行う時間 (MATLAB コード生成)
説明
は、コード セクションの実行時間を測定する期間に対応する時間ベクトルを返します。Time
= NthSectionProfile
.Time
例
コード セクションの時間ベクトルの取得
この例を開いて、このチュートリアル用のファイルを取得します。
kalman01.m
— カルマン推定器の MATLAB® 関数test01_ui.m
—kalman01.m
をテストする MATLAB ファイルplot_trajectory.m
— 実際のターゲットの軌跡とカルマン推定器の出力をプロットするファイルposition.mat
— 入力データ
openExample('ecoder/KalmanFilterExample')
SIL 実行を設定して実行します。
config = coder.config('lib'); config.GenerateReport = true; config.VerificationMode = 'SIL'; config.CodeExecutionProfiling = true; codegen('-config', config, '-args', {zeros(2,1)}, 'kalman01'); coder.runTest('test01_ui', ['kalman01_sil.' mexext]);
実行の最後に次のメッセージが表示されます。
To terminate execution: clear kalman01_sil
Execution profiling report available after termination.
リンク clear kalman01_sil
をクリックします。
### Stopping SIL execution for 'kalman01'
Execution profiling report: report(getCoderExecutionProfile('kalman01'))
実行時間のデータを保持するワークスペース変数を作成します。
executionProfile=getCoderExecutionProfile('kalman01');
2 番目のコード セクションのプロファイルを取得します。
secondSectionProfile = executionProfile.Sections(2);
コード セクションの時間ベクトルを取得します。
time = secondSectionProfile.Time;
入力引数
NthSectionProfile
— coder.profile.ExecutionTimeSection
オブジェクト
coder.profile.ExecutionTime
プロパティ Sections
で生成されるオブジェクト。
出力引数
Time
— 時間
double
コード セクションについての測定を行う時間 (秒単位)。ベクトルとして返されます。
バージョン履歴
R2013a で導入
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)