How do I convert a string into a plotable time format?

I have an array called time that is storing time stamps as strings read in from an excel file:
time =
'4/3/2017 12:30:17 PM'
'4/3/2017 12:30:17 PM'
'4/3/2017 12:30:18 PM'
...
How do I convert these values into numerical times that I can then use to plot data?

답변 (2개)

Star Strider
Star Strider 2017년 5월 4일
Try this:
time = ['4/3/2017 12:30:17 PM'
'4/3/2017 12:30:17 PM'
'4/3/2017 12:30:18 PM'];
dnv = datenum(time); % Date Number Vector
check = datevec(dnv); % Check Conversion (Delete)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

질문:

2017년 5월 4일

편집:

2017년 5월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by