2D grid interpolation problem

3 visualizaciones (últimos 30 días)
Luke Blades
Luke Blades el 17 de Abr. de 2016
Comentada: Taindra Neupane el 1 de Oct. de 2020
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 comentario
Taindra Neupane
Taindra Neupane el 1 de Oct. de 2020
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!

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 18 de Abr. de 2016
Look in the File Exchange for John D'Errico's inpaint_nans
  1 comentario
Luke Blades
Luke Blades el 18 de Abr. de 2016
Perfect, works a treat. Thanks!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by