I have three dimension daily data contaning (station, year, day)(387x2x365), i need to convert into monthly mean for each year (387x2x12).current code is attached below, thank you.load('prec_aphrodite.mat')prec=prec_aphrodite;for i=1:2 for ii=1:387 days=[31 28 31 30 31 30 31 31 30 31 30 31] dd=0; for mm=1:12 mmprec=prec((dd+1):days(mm)),3); for ddd=1:days(mm) prec_aph_mm(ii,i,mm)=nanmean(prec(((dd+1):dd+days(mm)),3)) dd=dd+days(mm) end endend
MATLAB: How to convert three dimension daily data into monthly mean
daily to monthly
Best Answer