How to measure elapsed time in hh:mm:ss?
조회 수: 37 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Kunal Kandhari
2023년 1월 30일
tic;
s = seconds(toc/86400);
s.Format = 'hh:mm:ss'
Hope this helps!
댓글 수: 1
Stephen23
2023년 1월 30일
The output of TOC is already in seconds... so dividing by the number of seconds in one day is not useful here.
참고 항목
카테고리
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!