how to convert three dimension daily data into monthly mean?
Show older comments
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
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!