How to find computational time?
35 ビュー (過去 30 日間)
古いコメントを表示
I want to find the computation time for the Add in below code. How can I do that? Is there any command?
I can use tic & toc which will give the elapsed time. but I want to find computation / execution time.
Does anyone know? Please help me.
Matlab code
A=[1 2 3 4 56 7 8 9];
B=[7 8 9 4 55 1 2 3];
tic
for i=1:length(A)
Add(i) = A(i)+ 2* B(i);
end
toc
1 件のコメント
Image Analyst
2021 年 12 月 12 日
What is the difference between elapsed time and computation time? Of course your computer is also doing all kinds of stuff in the background and I'm not sure we can figure out the percentage of time it spent on only your MATLAB code. But what does it matter? It's the elapsed time that really matters in the real world, right?
採用された回答
その他の回答 (2 件)
Nasser Almabrok
2024 年 2 月 9 日
I think you are looking for the time taken for the process to finish or to stop for one cycle. tic toc is your answer.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!