Not plotting the data

2 visualizzazioni (ultimi 30 giorni)
Michelangelo Cannistraro
Michelangelo Cannistraro il 1 Dic 2022
Risposto: Walter Roberson il 1 Dic 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

Risposta accettata

Walter Roberson
Walter Roberson il 1 Dic 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.

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by