time series plot
이전 댓글 표시
I am trying to plot tidal level over time, but am struggling to get the date and time accurately along the X-axis. The time data is currently in a date vector format of 6 columns [dd mm yy hh mm ss]. What is the best way to convert this data into a format which can be plotted on the x-axis against water level? The matrix lengths are the same. Cheers!
답변 (3개)
Wayne King
2012년 5월 25일
Did you use datenum and datetick?
t = (1900:10:1990)'; % Time interval
p = [75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633]'; % Population
plot(datenum(t,1,1),p) % Convert years to date numbers and plot
datetick('x','yyyy') % Replace x-axis ticks with 4 digit year labels.
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!