How can I read and extract Fill Value from netcdf file

조회 수: 2 (최근 30일)
Farshid Daryabor
Farshid Daryabor 2020년 4월 9일
댓글: Farshid Daryabor 2020년 4월 9일
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일
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');

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

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by