how to plot the time series data with dates showing in x axis
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Farshid Daryabor
am 18 Mär. 2020
Kommentiert: Cris LaPierre
am 19 Mär. 2020
I can plot time series but I am not able to show exact dates on x axis. I really appreciate anybody can help me. Thanks
figure
Ts = timeseries(Ta);
plot(Ts,'r')
grid on
grid minor
xlabel('Time','fontsize',14)
ylabel('Temperature (\circC)','fontsize',14)
Problem, cannot manage date lable, you can find attached file may show me how it's work.
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 18 Mär. 2020
Bearbeitet: Cris LaPierre
am 18 Mär. 2020
Convert your dates to the datetime data type. Then, when you plot using the datetime, the date will appear on the axis. You can set the display format of a datetime to show the date however you'd like.
load example.mat
Time = datetime(time,'ConvertFrom',"excel")
plot(Time,Ta)
14 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Time Series Objects finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!