how to convert three dimension daily data into monthly mean?
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!