Not plotting the data

3 views (last 30 days)
load data_matrix.mat
cleanup=data([1 2 3 row],:);
for i=1:12
a=find(cleanup(:,2)==i); %Find the 12 months of the year
meanT=cleanup(a,[1,3]); %Find the mean T of every month of the year
subplot(3,4,i) %Plot the results using subplot
plot(meanT(:,1),meanT(:,2))%The plot is shown in question 5 with the
ylabel('Mean T(degree C)')
title({'Month' i})
I attached two files that gets the 'cleanup' variable matrix that has the data to plot. When I run the script it shows the 12 graphs but with no data. The point is to plot the temperature means of each month from 1975 to 2016. So all of the januarys from 1975 to 2016 with be on one graph. I do not understand why it is not showing the data in the plot

Accepted Answer

Walter Roberson
Walter Roberson on 1 Dec 2022
Your array cleanup has 4 rows and a fair number of columns. cleanup(:,2) is one column with of the 4 rows. You probably want to be working with row 2 of cleanup instead of column 2.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!