How Can i get MATLAB to plot date on x-axis?
Mostrar comentarios más antiguos
Hey, I have an issue concerning getting MATLAB to plot dates on X-axis.
my time matrix is a 2924x1 matrix representing hours since start, with 6 hours intervalls. So: t=[6, 12, 18, 24, ..., 17544]. My starting time is [2015, 9, 1] (sep.1.2015) at 0600.
If someone could help me getting MATLAB to plot dates on the x-axis instead of numbers up to 17544, that would be very helpful.
Thx! :)
Respuestas (2)
Star Strider
el 14 de Feb. de 2018
0 votos
Peter Perkins
el 15 de Feb. de 2018
Since R2014b:
d = datetime(2015,9,1,0:6:17544,0,0);
x = cumsum(randn(size(d)));
plot(d,x)

3 comentarios
Ayomide Olabode
el 12 de Oct. de 2019
In my case, I need to have both the hour (from hour 0 to 24) and date show for each day. Can you help please?

Star Strider
el 13 de Oct. de 2019
Post this as a new Question. It is not an Answer to the posted Question in this thread.
Geletaw Behailu
el 26 de Mzo. de 2020
I have the same question as Ayomide Olabode , I need the way how to plot as shown in his question above
Categorías
Más información sobre Dates and Time en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!