I have I have a data containing daily pricipitation data from 2001 to 2010, each year I have 1 file
lon=ncread(ncfile,'lon');lat=ncread(ncfile,'lat');precip=ncread(ncfile,'precip');precip 360 x 280 x 365lat 280x1lon 360x1
I want to calculate the monthly mean for each year and then calculate average for 10 years.
the slow way I can do like that:
JAN{K}=nansum(precip{K}(:,:,1:31),3); %K is number of year
FEB{K}=nansum(precip{K}(:,:,32:59),3);JAN=cat(3,JAN{:});JAN=mean(JAN,3);
but for 2004, 2008 we have 366 day and this way is not very good to calculate
How can I do that with loop?
Thanks
Best Answer