I am trying to use the command ncdisp(source) for displaying the contents in a netcdf file. But I keep getting the following errors:
Error using netcdflib
The NetCDF library encountered an error during execution of 'open' function - 'Unknown file format (NC_ENOTNC)'.
Error in netcdf.open (line 59)
[varargout{:}] = netcdflib ( 'open', filename, varargin{1} );
Error in internal.matlab.imagesci.nc/openToRead (line 1265)
this.ncRootid = netcdf.open(this.Filename,'NOWRITE');
Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();
Error in ncdisp (line 50)
ncObj = internal.matlab.imagesci.nc(ncFile);
What am I doing wrong, I would like to know? Thank you!

댓글 수: 9

What does
which ncdisp
/MATLAB/toolbox/matlab/imagesci/ncdisp.m
show up?
Anamika Das
Anamika Das 2022년 3월 10일
편집: Anamika Das 2022년 3월 10일
which ncdisp is showing this:
C:\Program Files\MATLAB\MATLAB Production Server\R2015a\toolbox\matlab\imagesci\ncdisp.m
KSSV
KSSV 2022년 3월 10일
Is the file huge? Or small? If small one attach here.
Anamika Das
Anamika Das 2022년 3월 10일
Yes,the file is huge.
KSSV
KSSV 2022년 3월 10일
Did you try with a samll ncfile? I suspect the file is corrupt (I might be wrong though).
Anamika Das
Anamika Das 2022년 3월 10일
No,I havent tried that.
Anamika Das
Anamika Das 2022년 3월 10일
If the file does turn out to be corrupt,what should i do then?
KSSV
KSSV 2022년 3월 10일
You try out reading other nc files and check.
Anamika Das
Anamika Das 2022년 3월 10일
Okay.

댓글을 달려면 로그인하십시오.

답변 (0개)

질문:

2022년 3월 10일

댓글:

2022년 3월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by