Cannot display/open NetCDF files - Please help!
18 views (last 30 days)
Show older comments
ahamahoru
on 17 Mar 2020
Commented: Walter Roberson
on 17 Mar 2020
Hello,
Thank you very much for reading the question!
I have trouble reading my 31 nc files using ncdisp and netcdf.open. Here's my script:
folder='C:\xxx\';
liste=dir(folder);
for i=3:length(liste)
ncfile=liste(i).name;
% open nc
ncdisp(ncfile)
ncid=netcdf.open(ncfile);
end
It was working perfectly yesterday, but today it's not working for both ncdisp and netcdf.open after i switched directory folder to work on another m files. After i switched back to the right folder, the problem started. Here is the error message:
Error using internal.matlab.imagesci.nc/openToRead (line 1272)
Could not open 21413_20100615to20120713_qc.nc for reading.
% 21413_20100615to20120713_qc.nc is the first file i want to open
Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();
Error in ncdisp (line 62)
ncObj = internal.matlab.imagesci.nc(ncFile);
If i turn off the ncdisp and run the netcdf.open, here is the error message:
Error using netcdf.open (line 52)
Could not open file '21413_20100615to20120713_qc.nc'.
Could someone please help me on this? I know it's not about the data because i redownload the same data and it's still stuck. My best shot will be redownloading the netcdf pack again, but i would really like to know the reason behind this. I am using matlab R2019b.
Thank you so much for your help!
0 Comments
Accepted Answer
Walter Roberson
on 17 Mar 2020
ncfile = fullfile(folder, liste(i).name);
2 Comments
Walter Roberson
on 17 Mar 2020
In order for the code to work you would have to have been cd to the folder.
More Answers (0)
See Also
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!