Azzera filtri
Azzera filtri

Plotting multiple days on one graph

2 visualizzazioni (ultimi 30 giorni)
Benson
Benson il 15 Lug 2013
So normally, I would do something like this:
yValue = [1 2 3 4 5];
time = [8.5 10 10.20 13.4 15.2]; %(8.5 = 8:30:00)
plot(time, yValue);
However, this restricts me to only one full day between 0:00:00 and 24:00:00. What if I wanted to include multiple days in one graph? So time = ['6/10/2013 8.5', '6/10/2013 10', '6/10/2013 15.2', '6/11/2013 4.5', '6/12/2013 15.6']
All help is appreciated, thanks!

Risposte (1)

Iain
Iain il 15 Lug 2013
Plot the times as date numbers (check the documentation for "datenum") Change the x axis labels to the "datestr" with something like:
set(gca,'XTickLabel',datestr(get(gca,'XTickLabel),fmt))

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by