Find the mean from a mat file

13 次查看(过去 30 天)
Viktoriya
Viktoriya 2022-11-30
I have a large mat file that looks like that:
The first row is the year from 1975 to 2016, the second is month, and the third is the day, the others are different locations, from column 4 onward it is the daily temperature. With that i need extract mean monthly temperature, extreme minimum monthly temperature (the daily temperature in the coldest day of the month), and extreme maximum monthly temperature (the daily temperature of the hottest day of the month), of one specific location (on row 67).
Here is what i have so far, and i dont know what to do next:
s =load('data_sectionM.mat') ;
year=SECTION_M(1,:);
month=SECTION_M(2,:);
day=SECTION_M(3,:);
temp=SECTION_M(67,:);
mydata=[year, month, day, temp];
A=mydata;
for i=1975:2016
for j=1:12
c={i,j,temp}
end
end

回答(1 个)

Nihal Reddy
Nihal Reddy 2023-2-14
First you need to use indexing to index the monthly data. Then use the "mean" function to find the mean monthly temperature, "min" function to find extreme minimum monthly temperature and "max" function to find extreme maximum monthly temperature.
Refer to the following documentation links for more information regarding these functions-

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by