Why calculated elapsed time of function 'ar' is different with function 'tic toc' and 'timeit'?

2 ビュー (過去 30 日間)
GeunHwan Kim
GeunHwan Kim 2019 年 3 月 8 日
コメント済み: GeunHwan Kim 2019 年 3 月 10 日
I want to compare computation complexity of Yule-Walker Method and other algorithm.
At firtst, I write the 2 codes below,
1) Calculate elapsed time using 'tic toc' function
tic;
ar(Test_Signal,N,'yw');
toc;
2) Calculate elapsed time using 'timeit' function
ff = @() ar(Test_Signal,N,'yw');
timeit(ff)
and results shows huge difference
1) 0.754736s
2) 0.0060s
Which result is correct? and how can I use this results with metric of computational complexity of algorithm?
  4 件のコメント
Walter Roberson
Walter Roberson 2019 年 3 月 9 日
You should probably use timeit(ff, 0) but that should not matter much.
GeunHwan Kim
GeunHwan Kim 2019 年 3 月 10 日
Thank you Walter!

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by