MATLAB: Accumulate in multiple array


I have:
Temperature profiles array for 5 days. such that, temp(heigth,day). however, there are multiple profile in some days which makes the number of profile equal 11.
size of temp = (3650 by 11)
size of day = (1 by 11)
I want to:
average temperature for every similar days
such that:
temp=(3650 by 5)

Best Answer

  • splitapply(@(x) mean(x,2),Temp,findgroups(Day))