MATLAB: How to take seasonal average of monthly values

for loopMATLABmeantime series

Hello, I have 10 years (120 months) temperature data set. Now I want to take seasonal average of these monthly dataset. season 1 (Jan, Feb, Mar), season 2 (apr, may, june), season 3 (july, aug, sep) and season 4(oct, nov, dec) for every year. Final time series will represent 30 values. Can anyone help me to solve this problem?

Best Answer

Depends on storage order...if 10x12 (years x months), then
Tseas=mean(reshape(T.',3,[]));
If it's already in column order by year, ditch the transpose .'