How to measure running time of a code using MATLAB
199 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jose Ricardo Milandro Hibaler
am 8 Nov. 2011
Kommentiert: Sandip
am 16 Dez. 2023
Hi. I am new in using MATLAB. I have a thesis about code optimization along with my partner. It was recommended by our adviser to use the software in order t measure the running time of the code. The code is in Java Programming Language. Now, how can I measure the running time of the code using MATLAB?
2 Kommentare
Paulo Abelha
am 17 Sep. 2016
Hi,
I've coded a function that might help you:
https://uk.mathworks.com/matlabcentral/fileexchange/59187-displayestimatedtimeofloop--tot-toc--curr-ix--tot-iter--
Rehan Ashraf
am 18 Okt. 2017
hi; where you want to calculate the time of your code so first you placed tic and toc command in your script.e.g: start tic; code toc
Akzeptierte Antwort
Lucas García
am 8 Nov. 2011
Maybe this article also helps:
Weitere Antworten (1)
Taha
am 3 Mai 2016
beginn your script with tic and end it with toc. At the end the Elapsed time is showed in MATLAB in seconds.
3 Kommentare
Aaya Aboelfotoh
am 11 Jun. 2019
Hi Taha,
Is there a way that the elapsed time can be stored as an output? Since I am recording the outputs from matlab to an excel file, i want it to also write the elapsed time as well (instead of manually reading the time and writing it down).
Siehe auch
Kategorien
Mehr zu Performance and Memory finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!