Display elapsed time in hours, minutes, and seconds
34 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kim Bostroem
am 19 Apr. 2023
Kommentiert: chicken vector
am 19 Apr. 2023
Since now datestr is discouraged, I would like to use datetime to display elapsed time in hours, minuts and seconds. My previous code was
datestr(toc, 'HH:MM:SS')
How can I replace this with a command using datetime?
0 Kommentare
Akzeptierte Antwort
chicken vector
am 19 Apr. 2023
time = seconds(4321)
time.Format = 'hh:mm:ss'
6 Kommentare
chicken vector
am 19 Apr. 2023
the command seconds is returning an instance of the class duration, that's why you can include the 'Format' command in duration, but not in seconds.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time 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!