フィルターのクリア

Plot time series data in MATLAB

3 ビュー (過去 30 日間)
Chayan Roychoudhury
Chayan Roychoudhury 2018 年 5 月 11 日
回答済み: Cathal Cunningham 2018 年 5 月 11 日
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.
  2 件のコメント
dpb
dpb 2018 年 5 月 11 日
Show us specifically
  1. what the time data storage is and
  2. 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?
Chayan Roychoudhury
Chayan Roychoudhury 2018 年 5 月 11 日
The time data storage isnt explicit. The data file has two columns- the first containing the time points as a serial number from 1 to 5456 and the other column with the parameter values.
I want the x axis showing July of each of the 4 years. And each July will have 124 data points.

サインインしてコメントする。

回答 (1 件)

Cathal Cunningham
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)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by