필터 지우기
필터 지우기

Not plotting the data

조회 수: 4 (최근 30일)
Michelangelo Cannistraro
Michelangelo Cannistraro 2022년 12월 1일
답변: Walter Roberson 2022년 12월 1일
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

채택된 답변

Walter Roberson
Walter Roberson 2022년 12월 1일
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개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by