How to measure elapsed time in hh:mm:ss?
29 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
till now I measured elapsed time with:
tic;
% some code here
datestr(toc/86400,'HH:MM:SS')
Matlab R2022b says "datestr" is not recommended anymore. So how can I now convert timer-value (in seconds) to "hours-minutes-seconds"?
0 Kommentare
Antworten (2)
Kunal Kandhari
am 30 Jan. 2023
tic;
s = seconds(toc/86400);
s.Format = 'hh:mm:ss'
Hope this helps!
1 Kommentar
Stephen23
am 30 Jan. 2023
The output of TOC is already in seconds... so dividing by the number of seconds in one day is not useful here.
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB 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!