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

matricesmatrixmatrix arraymatrix manipulation

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

Best Answer

Make your array 4-dimensional,
a=reshape(a, 129,135,24,30);
hourlymeans=mean(a,4);
[~,minhour]=min(hourlymeans,[],3);