How can I add time labels to the x-axis of my plot?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sample data .if i have data like this how to plot with exact date and time
with seconds give me a program
31/08/97 03:03:32
31/08/97 03:07:39
31/08/97 03:10:46
31/08/97 03:15:46
31/08/97 03:26:59
31/08/97 03:28:00
31/08/97 03:42:56
31/08/97 03:54:23
31/08/97 03:56:57
31/08/97 04:07:00
31/08/97 04:47:51
31/08/97 22:07:59
1 Kommentar
dpb
am 16 Apr. 2014
Bearbeitet: dpb
am 16 Apr. 2014
See
doc datenum
doc datetick
and examples thereat
ADDENDUM:
OK at machine w/ a minute...try
>> dn=datenum(datevec(t,'dd/mm/yy HH:MM:SS')); >> plot(dn,rand(size(dn))) >> datetick('x','keeplimits','keepticks')
NB: I cleaned up the above data strings that had tab here and there down to a single space; use format as needed for the actual form.
Antworten (1)
Ralf
am 16 Apr. 2014
I hope it is clear now:
DateTime{1,1} = '31/08/97 03:03:32'; %
DateTime{1,2} = '31/08/97 03:07:39'; %
Yvalue = [3 4]; % Example values
ts1 = timeseries(Yvalue,DateTime); % Create a timeseries object whit oure yvalue %and the time scale
ts1.Name = 'Warming up off ... '; % Give it a name
plot(ts1); % Create a plot of it.
grid ('on');
Siehe auch
Kategorien
Mehr zu Title 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!