Clear Filters
Clear Filters

Error using netcdflib, error in

79 views (last 30 days)
My code to open and download files from a OPeNDAP URL is no longer working. It was working great, then all of a sudden I get errors. I am using Matlab R2020a. Thanks for the help. Barbara
The NetCDF library encountered an error during execution of 'open' function - 'Malformed or inaccessible DAP DDS
(NC_EDDS)'. If the data source was an OPeNDAP URL, see the OPeNDAP Troubleshooting section in the Users Guide.
Error in (line 67)
[varargout{:}] = netcdflib ( 'open', filename, varargin{1} );
Error in (line 1278)
this.ncRootid =,'NOWRITE');
Error in (line 121)
Error in ncread (line 61)
ncObj =;
myVar = 'tmin';
myURL = ['',myVar,''];
latList=[41 44 45 41]; %list of north latitudes for each point location
lonList=[-110 -100 -101 -95]; %list of East longitudes for each point location
NUM_POINTS = length(latList');
year_start = 1980;
year_end = 2019;
timebounds_start =datenum(year_start,month_start,1)-datenum(1900,1,1);
timebounds_end = datenum(year_end,month_end,1)-datenum(1900,1,1);
timebounds = [timebounds_start timebounds_end];
ftimei=find(time>=timebounds(1) & time<=timebounds(2));
time = time(ftimei);
NUM_TIME= length(time);
myLat = NaN(NUM_POINTS,1);
myLon = NaN(NUM_POINTS,1);
for i= 1:NUM_POINTS;
myData(i,:)=ncread(myURL,myVar,[floni(1) flati(1) ftimei(1)],[length(floni) length(flati) length(ftimei)],[1 1 1]);
Kenny Larsen
Kenny Larsen on 20 Apr 2023
Did you ever find an adequate solution to this problem? I am having a similar problem and can'r for the life of me figure it out!
麟轩 马
麟轩 马 on 5 Oct 2023
I am having the same problem with the same database. Is there a solution yet please?

Sign in to comment.

Answers (1)

Prabhan Purwar
Prabhan Purwar on 11 May 2021
Hi Barbara,
This is a known issue with the NetCDF library in R2020a and is now fixed in R2020b and further releases.
The easiest workaround is to upgrade to R2020b or R2021a.
Please let me know if you are still having any concerns.
金龙 张
金龙 张 on 13 May 2021
I met the same problem with the moderator.
This error is still exist when I use R2021a. And the error will happen only when I want to read the data of uo.
size uo is : uo(lon,lat,lev,time)
I hope I won't disturb you.
my code:
error code:
错误使用 matlab.internal.imagesci.netcdflib
NetCDF 库在执行 'getVarFloat' 函数期间遇到错误 - 'HDF error (NC_EHDFERR)'。
出错 netcdf.getVar (第 182 行)
data = matlab.internal.imagesci.netcdflib(funcstr,ncid,varid,varargin{:});
出错 (第 607 行)
data = netcdf.getVar(gid, varid);
出错 ncread (第 66 行)
vardata =, varargin{:});
chao wei
chao wei on 7 Mar 2022
Pleat try this with full path filename

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!