2D interpolation - how to deal with "missing" data

Hello!
I have a matrix with missing numbers. There are some rows and columns missing; these I can find by interpolating with interp2. However, there are also some gaps, i.e. "missing" data, in my matrix that can not be retrieved by the same method. These empty entries are automatically set to 0 (zero) when I import my data to Matlab, and are subsequently treated as such instead of treated as gaps which need to be "filled" when I try to use interp2.
I could do a 1D interpolation at each row, column, and/or diagonal where there are gaps, but I am afraid that this would give me less good results (as I only take two out of eight neighbours into account) and that it will take me a lot of time.
Is there any easy way to perform an interpolation to fill the gaps?
Any help would be much appreciated!
Thank you
/Tomas

1 件のコメント

nancy gupta
nancy gupta 2014 年 2 月 2 日
how you processed interpolation diagonally? Actually I am stuck with it.
Thank You

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

 採用された回答

Image Analyst
Image Analyst 2011 年 12 月 18 日

0 投票

How about using triscatteredinterp()?

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 12 月 18 日

1 投票

Perhaps John's File Exchange contribution inpaint_nan would work for you.

1 件のコメント

Tomas
Tomas 2011 年 12 月 19 日
This did the trick - thank you very much!

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

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2011 年 12 月 18 日

コメント済み:

2014 年 2 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by