How can I read and extract Fill Value from netcdf file

I really thanks someone tell me how can I extract fill value, I used following comment it doesn't work. Thanks in advance.
FillValue = ncreadatt (ncfilename, 'PRES', 'FillValue_');
nc {'PRES'}. FillValue_ = ncfloat (99999);

1 件のコメント

Farshid Daryabor
Farshid Daryabor 2020 年 4 月 9 日
FillValue = ncreadatt( ncfilename, 'PRES', '_FillValue' );
It's work now,

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

回答 (1 件)

BN
BN 2020 年 4 月 9 日

0 投票

Try this:
I assume that the name of your NetCDF is filename
vinfo = ncinfo(filename) % You can see the struct now
Fill_v = vinfo.Variables.FillValue % extract fill value
Also you can read more here

1 件のコメント

Farshid Daryabor
Farshid Daryabor 2020 年 4 月 9 日
Dear Behzad,
Thanks for your valuable comment, I have already fix it as follow,
FillValue = ncreadatt (ncfilename, 'PRES', '_FillValue');

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

質問済み:

2020 年 4 月 9 日

コメント済み:

2020 年 4 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by