Error reading NetCDF files

1 回表示 (過去 30 日間)
Thodoris Ptrks
Thodoris Ptrks 2020 年 1 月 13 日
コメント済み: Thodoris Ptrks 2020 年 1 月 13 日
Hello! I'm trying to read a NetCDF file using this:
f='global.nc';
fid=fopen(f,'r');
Temp=ncread(f,'t');
U=ncread(f,'u');
but it shows an error message, something like this:
Error using netcdflib
The NetCDF library encountered an error during execution of 'inqFormat' function - 'Not a valid ID
(NC_EBADID)'.
Error in netcdf.inqFormat (line 29)
fmt = netcdflib('inqFormat',ncid);
Error in internal.matlab.imagesci.nc/openToRead (line 1281)
this.Format = lower(netcdf.inqFormat(this.ncRootid));
Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();
Error in ncread (line 53)
ncObj = internal.matlab.imagesci.nc(ncFile);
Any ideas of what is going wrong! Thank you!
  7 件のコメント
BN
BN 2020 年 1 月 13 日
I think maybe your NetCDF file is corrupted. can you open the attached NetCDF file which I sent to you?
Thodoris Ptrks
Thodoris Ptrks 2020 年 1 月 13 日
no.. by the way thanks for your time..!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by