How to skip rows when loading data from a netcdf file
Show older comments
Hi, I am reading temperature data from a netcdf file that is a (720x360x744) matrix (it depends on longitude, latitude and time). For the latitude and longitude I only use one row depending on which city I am looking at. The temperature is measured several times a day for one month but I only want to get one measure per day. Is there a way for me to skip some rows in the last column? I want only every 24 rows, I want row 25,49,73 etc. not the ones in between.
My code so far is :
[varname, xtype, varDimIDs, varAtts] = netcdf.inqVar(Ncid111,3);
varid = netcdf.inqVarID(Ncid111,varname);
airtemp = netcdf.getVar(Ncid111,varid');
mydata=airtemp(220,114,1:744)
This gives me the whole TIME column (measures 1 through 744) but I only want every 24th measure.
Thank you for your help!!
Accepted Answer
More Answers (0)
Categories
Find more on NetCDF 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!