converting a column of text dates and time to actual day fraction
6 views (last 30 days)
Show older comments
How can I convert a column of text that is in the form of 'yyyy-MM-ddTHH:mm:ss.SSSZ' (expample: 2021-03-05T19:09:32.840Z) to something I can use as an X-axis on a plot. I'm kind of new at this. I'm really more concerned with the tiime of day rather than the year.
Thanks,
Shane
0 Comments
Answers (1)
Cris LaPierre
on 24 Mar 2021
Convert it to a datetime, and use that as your x value.
T = "2021-03-05T19:09:32.840Z";
x = datetime(T,"InputFormat",'yyyy-MM-dd''T''HH:mm:ss.SSS''Z')
plot(x,5,'*g')
2 Comments
Cris LaPierre
on 26 Mar 2021
More lines of code than you need, but if it works for you, that's good enough for me.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!