0
votes

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.

enter image description here

2
It is unclear what you want, and even more unclear when reading your response to the current answer. Do you want to average the data for each month, or otherwise reduce the number of datapoints somehow? Label the axis with year info? What does "efficiently" mean to you?nkjt
I want to keep the number of data points same. But to label the x axis by 44 Julys.Chayan Roychoudhury

2 Answers

0
votes

As you don't give any more details, it is hard to know exactly what you are asking. If you have a matrix A with two columns, then you are looking for

plot( A(:,1), A(:,2) )

Alternatively, perhaps you want to see the histogram, hist, or the scatter plot scatter.

0
votes

Well your X-axis(time data) is most probably not in datetime format & hence the problem.Once that is done, the plot will show what you want. You should try and change it to datetime & then try

plot(X,Y) 

or

plot(A(:,1),A(:,2))

whichever be your data format