How to subtract time in million second precision?
이전 댓글 표시
I have 2 table arrays of date(1st column) and time (2nd column) and I would like to check the time difference. Could you kindly advise?
My second values are in million second precision, e.g., 11:34:08.471810 and 11.34.06.471840 (as attached picture) How may I go about getting the time difference? I understand some of MATLAB function has limitation till millisecond. Have tried a few stuff (datevec, datenum, etc.) but not getting the precise results.
Thank you.
채택된 답변
추가 답변 (1개)
Peter Perkins
2017년 7월 24일
It might also be worth noting that since you already have the time as a separate thing, you can also do this:
>> t1 = duration(11,34,08,471.810,'Format','hh:mm:ss.SSSSSS')
t1 =
duration
11:34:08.471810
>> t2 = duration(11,34,06,471.840,'Format','hh:mm:ss.SSSSSS')
t2 =
duration
11:34:06.471840
>> t1 - t2
ans =
duration
00:00:01.999969
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!