Main Content

Time

コード セクションの実行時間の測定を行う時間 (MATLAB コード生成)

説明

Time = NthSectionProfile.Time は、コード セクションの実行時間を測定する期間に対応する時間ベクトルを返します。

すべて折りたたむ

この例を開いて、このチュートリアル用のファイルを取得します。

  • kalman01.m — カルマン推定器の MATLAB® 関数

  • test01_ui.mkalman01.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;

入力引数

すべて折りたたむ

coder.profile.ExecutionTime プロパティ Sections で生成されるオブジェクト。

出力引数

すべて折りたたむ

コード セクションについての測定を行う時間 (秒単位)。ベクトルとして返されます。

バージョン履歴

R2013a で導入