Error using matlab.int​ernal.imag​esci.netcd​flib , R2021b

38 次查看(过去 30 天)
I get an error using ncread
The script works on earlier release (R2020a)
What could be the reason for this?
---------------------
Error using matlab.internal.imagesci.netcdflib
The NetCDF library encountered an error during execution of 'open' function - 'I/O failure (NC_EIO)'. If the data source was an OPeNDAP URL, see the OPeNDAP Troubleshooting
section in the Users Guide.
Error in netcdf.open (line 67)
[varargout{:}] = matlab.internal.imagesci.netcdflib ( 'open', filename, varargin{1} );
Error in internal.matlab.imagesci.nc/openToRead (line 1280)
this.ncRootid = netcdf.open(this.Filename,'NOWRITE');
Error in internal.matlab.imagesci.nc (line 124)
this.openToRead();
Error in ncread (line 61)
ncObj = internal.matlab.imagesci.nc(ncFile);
Error in file (line 56)
lon = ncread(urlget,'longitude');
>>

回答(1 个)

Abhijeet
Abhijeet 2024-1-22
Hi Simon ,
I understand that you are facing isssue while using "ncread" function in MATLAB R2021b.
This is a known issue with the recent versions of the NetCDF library that is used by "ncread" function to query the OPeNDAP data. There has been a change in the implementation of this third-party library which is causing unintended errors in MATLAB and other programming languages that use this library.
To resolve this issue please refer either of the following workaround :-
1. Prepend the "ncread" source URL with “[fillmismatch]”
time=ncread("[fillmismatch]http://sccoos.org/thredds/dodsC/autoss/scripps_pier-2019.nc","time"");
2. Append the "ncread" source URL with “#fillmismatch”
time=ncread("http://sccoos.org/thredds/dodsC/autoss/scripps_pier-2019.nc#fillmismatch","time"");
I hope this resolves the issue you were facing.

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by