2D grid interpolation problem

3 ビュー (過去 30 日間)
Luke Blades
Luke Blades 2016 年 4 月 17 日
コメント済み: Taindra Neupane 2020 年 10 月 1 日
Hello,
I'm having trouble with 2d interpolation using interp2.
I have a grid of data, 200x200. I've plotted the surface and there are some values missing from my data set. I need to calculate the volume beneath this surface and to do that i need to get rid of any NaN values so the trapz function will work.
I've tried using interp2 but i get the error "Interpolation requires at least two sample points in each dimension."
There is no row or column in my data matrix which is composed entirely of NaN. Is it an issue if there are several NaN values in a row (does it interpolate between values 1 cell apart)?
Any help greatly appriciated, this is driving me nuts!
Many thanks,
Luke
  1 件のコメント
Taindra Neupane
Taindra Neupane 2020 年 10 月 1 日
Hello Friends,
I have a 2d uniformly gridded data (like an image or dose with specific voxel size), I am looking for interpolation funtion to divide into +ve interger as well as non-integer values like 1, 1.5,2....! I am using interpn (A,k) or interpn2 (A,k) but its interpolating only into even +ve intergers points/values like k=0, no interpolation, k=1, two values, k=2, 4 values as it divide into 2^k -1 values. So, I am wondering if I want to divide 3mmx3mm pixel into 1mmx1mm pixel (3 sections). Please help me on this.
Thanks in advance!

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

採用された回答

Walter Roberson
Walter Roberson 2016 年 4 月 18 日
Look in the File Exchange for John D'Errico's inpaint_nans
  1 件のコメント
Luke Blades
Luke Blades 2016 年 4 月 18 日
Perfect, works a treat. Thanks!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by