How to get daily minimum value of temperature from a three dimensional matrix?

조회 수: 1 (최근 30일)
Let us say we have a matrix (say 'a') with 129x135x721 dimension.i.e.lat x lon x time... time is 720 (24*30)for hourly data for one month values. Suppose this data is temperature data. Now i need to know at what time of the day temperature is minimum.So for that, first i need to find mean value of temperature at all 1 o'clock,2,3,4 all 24 hr. i.e.,mean of (1:25:720) Similarly mean of (2:26:720) and so on. Then finally for each lat,lon we get 24 values now, or we will get a final matrix of 129x135x24 and from this i need to find the minimum value time. Please help me how to to do it

채택된 답변

Matt J
Matt J 2016년 7월 18일
편집: Matt J 2016년 7월 18일
Make your array 4-dimensional,
a=reshape(a, 129,135,24,30);
hourlymeans=mean(a,4);
[~,minhour]=min(hourlymeans,[],3);
  댓글 수: 2
trailokya
trailokya 2016년 7월 18일
I also need the hourly means matrix that should be 129*135*24 But I am not getting this by running the above codes...
Matt J
Matt J 2016년 7월 18일
Works fine for me,
>> a=rand(129,135,24,30);
>> hourlymeans=mean(a,4); whos hourlymeans
Name Size Bytes Class Attributes
hourlymeans 129x135x24 3343680 double

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2016년 7월 18일
T = rand(129,135,721) ;
Min = zeros(721,1) ;
for i = 1:721
Ti = T(:,:,i) ;
Min(i) = min(Ti(:)) ; % Minimum value at evry time step
end
[val,idx] = min(Min) ;
  댓글 수: 1
trailokya
trailokya 2016년 7월 18일
First i need the hourly average values (say for the whole month). The final matrix should be 129*135*24...how is it possible Sir?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by