Fillmissing: Change missing value definition?

11 ビュー (過去 30 日間)
mcd
mcd 2018 年 7 月 26 日
コメント済み: Greg Dionne 2018 年 9 月 24 日
Hello, Is there a way to change/customize the "missing value" definition in the "fillmissing" function? In other words, I'd like to my missing numeric values to be defined as "0", and not as NaNs. I see that "ismissing" has a provision to specify the indicator, but I don't know if this can be used with "fillmissing".
I ask because I have a geospatial dataset I'm working with where I've masked the oceans as NaNs, and I need to fill land gridcells along the coasts which are currently specified as "0". I'd like to fill these coastal land values with the nearest neighbor approach. As such, I don't want to convert the ocean gridcells to numbers, as they erroneously might be used as part of this approach to fill my coastal cells.
The fillmissing capability would be perfect if I could specify the value to be replaced! Any ideas would be helpful.
Thanks
  1 件のコメント
Greg Dionne
Greg Dionne 2018 年 9 月 24 日
Let us know if you've tried the following syntax:
fillmissing(...,'constant',0)

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

回答 (2 件)

Sean de Wolski
Sean de Wolski 2018 年 7 月 26 日
編集済み: Sean de Wolski 2018 年 7 月 26 日
Do a standardizeMissing first to convert your 0s to NaNs, then fill missing.

mcd
mcd 2018 年 7 月 26 日
Thanks! I'll use this and then just reapply my ocean mask afterwards.

カテゴリ

Help Center および File ExchangeOceanography and Hydrology についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by