ncid = netcdf.open('data.nc', 'NC_NOWRITE');[ndim,nvar,natt,unlim] = netcdf.inq(ncid);[dimname,dimlength]=netcdf.inqDim(ncid,0);[dimname,dimlength]=netcdf.inqDim(ncid,1);[dimname,dimlength]=netcdf.inqDim(ncid,2);[dimname,dimlength]=netcdf.inqDim(ncid,3);netcdf.inqDim(ncid,dimids);[varname, xtype, dimid, natt] = netcdf.inqVar(ncid, 0);[varname, xtype, dimid, natt] = netcdf.inqVar(ncid, 1);[varname, xtype, dimid, natt] = netcdf.inqVar(ncid, 2);[varname, xtype, dimid, natt] = netcdf.inqVar(ncid, 3);[varname, xtype, dimid, natt] = netcdf.inqVar(ncid, 4); [varname, xtype, dimid, natt] = netcdf.inqVar(ncid, 5);lat = netcdf.getVar(ncid,0,0,72);lon = netcdf.getVar(ncid,1,0,144);precJanuary = netcdf.getVar(ncid,4,[0 0 0 0],[144 72 1 1]); % for january data
But how to calculate average? Suppose I have to calculate the average from 1st January to 5th January, then again 6th January to 10th January and so on…..
[Edited for code formatting -AU]
Best Answer