- what the time data storage is and
- explain how you want the forty-four months of data shown -- serially as above just labelled by year or as multiple lines (44 of 'em) as yearly observation on calendar axis Jul 1-->July 31 or something else entirely?
Plot time series data in MATLAB
2 次查看(过去 30 天)
显示 更早的评论
I have to plot a time series data in MATLAB. The Y axis is a parameter taken six hourly for each day in a certain month of the year. And 44 such years have been taken into account. From 1958 to 2001. So the points on the X axis are 4*31*44=5456. How can I plot the data efficiently in MATLAB? The data file has two column vectors. I have to plot the x axis so that it shows 44 July s from 1958 to 2001 . Each July has 124 points. One for the time points (5456 points) so 5456 rows and other for the parameter measured. Thanks a lot.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190493/image.png)
2 个评论
dpb
2018-5-11
Show us specifically
回答(1 个)
Cathal Cunningham
2018-5-11
You could try something like this:
yrs = [1958:1:2001];
lbls = cell(numel(yrs),1);
for i = 1:numel(yrs)
lbls{i} = sprintf('July %d',yrs(i));
end
figure
time = 1:4*31*numel(yrs);
data = randi(50,1,length(time));
plot(time,data)
set(gca,'XTick',[1:4*31:4*31*numel(yrs)])
set(gca,'XTickLabel',lbls)
xtickangle(gca,45)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!