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
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)
Steven Lord
2017-5-5
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!