Display elapsed time in hours, minutes, and seconds
46 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
chicken vector
2023-4-19
time = seconds(4321)
time.Format = 'hh:mm:ss'
6 个评论
chicken vector
2023-4-19
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!