Gridded Interpolation from an irregular grid

9 visualizaciones (últimos 30 días)
Adam
Adam el 6 de Nov. de 2013
Editada: Matt J el 6 de Nov. de 2013
I have some 2D data that needs to be interpolated to a finer grid. I'm fairly certain that MATLAB can do this with one of it's interpolation functions but I am new to MATLAB and haven't had much practice with the syntax.
My data that needs to be interpolated is essentially a value at an (x,y) coordinate. The grid spacing is not regular and I need to interpret it to a regular grid.
Data:
WC (ncells x 1) = values at each cell location (may contain replicate values)
xpos (ncells x 1) = x coordinate of each cell (contains replicate values)
ypos (ncells x 1) = y-coordinate of each cell (contains replicate values)
I tried using interp2, but it gave me an error about the data not increasing monotonically. Is there any way that MATLAB can interpolate this data to a regular grid?
Thanks in advance
A.
  1 comentario
Matt J
Matt J el 6 de Nov. de 2013
Editada: Matt J el 6 de Nov. de 2013
It's not clear from your description whether your data is really "gridded". Maybe you could post a scatter plot of the xpos, ypos data so that we can see what "irregular spacing" means.
Does each point in your WC data have neighbours that are perfectly horizontally/vertically adjacent to them? If no, your data is probably scattered, not gridded.
If yes, did you obtain xpos, ypos from ndgrid() or meshgrid() and then reshape them into column vectors? What process did create them?

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 6 de Nov. de 2013
See scatteredInterpolant()

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