フィルターのクリア

Find the mean from a mat file

10 ビュー (過去 30 日間)
Viktoriya
Viktoriya 2022 年 11 月 30 日
回答済み: Nihal Reddy 2023 年 2 月 14 日
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 Center および File ExchangeData Type Identification についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by