Why is ncread reading in times which are wrong by a year?
Mostrar comentarios más antiguos
I am getting the wrong year when I read in data from the file below using ncread.
url = 'http://nomads.ncep.noaa.gov:9090/dods/wave/wna/wna20150804/wna20150804_00z';
timeFromNetcdf = ncread(url, 'time');
datestr([timeFromNetcdf(1) timeFromNetcdf(end)])
ans =
04-Aug-2014 00:00:00
11-Aug-2014 12:00:00
You can see from the file name that the year is actually 2015 not 2014. Am I doing something wrong in ncread, perhaps due to the zero-based index in netcdf vs. one-based index in matlab, or is the time variable in the netcdf file simply wrong?
Respuesta aceptada
Más respuestas (1)
Rohit Kudva
el 6 de Ag. de 2015
0 votos
Hi,
I executed the code you provided and I was able to reproduce this issue. This seems to be a bug in MATLAB. I work for MathWorks and I have forwarded this feedback to the appropriate product team.
- Rohit
Categorías
Más información sobre NetCDF en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!