Why is ncread reading in times which are wrong by a year?
Mostra commenti meno recenti
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?
Risposta accettata
Più risposte (1)
Rohit Kudva
il 6 Ago 2015
0 voti
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
Categorie
Scopri di più su NetCDF in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!