フィルターのクリア

Speed of a MATLAB code

1 回表示 (過去 30 日間)
kartheek
kartheek 2013 年 5 月 28 日
Hello
How to calculate the speed of execution of a MATLAB Code?

採用された回答

Walter Roberson
Walter Roberson 2013 年 5 月 28 日
If you want to time with specific inputs, on your system, as currently configured, with the current load, then you can use http://www.mathworks.com/matlabcentral/fileexchange/18798-timeit-benchmarking-function
If you are trying to do an analysis of how the time varies with the size of the inputs, then in the general case you cannot do that. "Order analysis" needs to be done algebraically and through use of theorems.
  1 件のコメント
kartheek
kartheek 2013 年 5 月 28 日
Thanq Roberson. It worked.

サインインしてコメントする。

その他の回答 (1 件)

Iain
Iain 2013 年 5 月 28 日
You can measure the time taken to execute a chunk of code using "now", or tic and toc,
tic;
codegoeshere;
toc % prints the time taken to screen.
logtime(1) = now;
code_segment
logtime(2) = now;
code_segment
...
logtime(n) = now;
  1 件のコメント
kartheek
kartheek 2013 年 5 月 28 日
Thanq very much Lian. The technique worked and gave me my desired results.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by