필터 지우기
필터 지우기

How can I convert a double array into a timestamp array?

조회 수: 49 (최근 30일)
Guido Pastore
Guido Pastore 2019년 2월 26일
댓글: Peter Perkins 2019년 3월 11일
I have an array of double like:
ora: [737426.687937060 737426.687937141 737426.687937176 etc....]
I want to get an array like:
time:[16:30:37:762 16:30:37:769 16:30:37:772]
How can i do??

채택된 답변

Stephan
Stephan 2019년 2월 26일
편집: Stephan 2019년 2월 26일
Hi,
use:
B = datestr(A, 'HH:MM:SS.FFF')
B =
3×12 char array
'16:30:37.762'
'16:30:37.769'
'16:30:37.772'
to get it as datestring - or (better):
C = datetime(datestr(A, 'HH:MM:SS.FFF'),'InputFormat','HH:mm:ss.SSS','Format','HH:mm:ss.SSS')
C =
3×1 datetime array
16:30:37.762
16:30:37.769
16:30:37.772
to get it as datetime-type.
Best regards
Stephan
  댓글 수: 4
Guido Pastore
Guido Pastore 2019년 2월 26일
thank you so much!
Peter Perkins
Peter Perkins 2019년 3월 11일
Alternatively, timeofday(D) would also convert to a duration.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by