MATLAB: How to find the maximum value for each 24 rows in an array

arraycell arraysmatrix

Hello,
I have a 3d array, precip= :,:, 8760. in fact 8760 rows are available in one column. I want to find the maximum value in this column 24-by-24 in rows. And saving the bigger value and eliminate the smaller one. and do it for all 8760-row
so if the dimension before doing this is precip = :, :, 8760, after this work should be precip = :, :, 365.
I wanna practical this for a 3d array which the third dimension is what I talking about.
I'm attaching all my array. as the volume of original file is so big I cut first 72 rows and attach it
Thank you

Best Answer

According to the comments, you have provided, this will produce the desired output :
yd = max(max(mn2t)); % first find maximum for each hour
y = reshape(yd,24,1,size(yd,3)/24); % reshape it by day
output = max(y); % find maximum of each day
Let me know if this works !