Not plotting the data
2 views (last 30 days)
Show older comments
Michelangelo Cannistraro
on 1 Dec 2022
Answered: Walter Roberson
on 1 Dec 2022
load data_matrix.mat
data=SECTION_L;
data(:,1:3)=[];
row=9;
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
xlabel('Year')
ylabel('Mean T(degree C)')
title({'Month' i})
end
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
0 Comments
Accepted Answer
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!