Error reading netcdf file over internet

7 visualizzazioni (ultimi 30 giorni)
Khaled Hamed
Khaled Hamed il 20 Feb 2024
Modificato: Walter Roberson il 20 Feb 2024
The following code runs correctly without errors in online Matlab, Matlab Mobile, and even in this question box (when using the new RUN feature). Howver, on my Windows machines (10 and 11), the one-dimensional variable is read ok, but the three-dimensional variable throws the error shown below. Any idea how to fix this?
>> url='';
>> aa=ncread(url,'longitude',1,3)
aa =
3×1 single column vector
>> bb=ncread(url,'discharge',[1, 1, 1 ],[1, 1, 10 ])
Error using matlab.internal.imagesci.netcdflib
The NetCDF library encountered an error during execution of 'getVarsFloat' function - 'HDF error (NC_EHDFERR)'.
Error in netcdf.getVar (line 205)
data = matlab.internal.imagesci.netcdflib(funcstr,ncid,varid,varargin{:});
Error in (line 690)
data = netcdf.getVar(gid, varid, ...
Error in ncread (line 76)
vardata =, varargin{:});

Risposte (0)




Community Treasure Hunt

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

Start Hunting!

Translated by