Not plotting the data

10 vues (au cours des 30 derniers jours)
Michelangelo Cannistraro
Michelangelo Cannistraro le 1 Déc 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

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Déc 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.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by