Using griddata on an unstructured grid

26 visualizaciones (últimos 30 días)
Meghan
Meghan el 6 de Sept. de 2016
Comentada: Meghan el 7 de Sept. de 2016
Hello
This is probably a very silly question but I can't really wrap my head around griddata. I've used it previously but it was a lot more straight forward then!
So right now I have one set of coordinates (x,y) which represent and unstructured grid. I also have another set of coordinates with represent the centre of each of those triangles in the unstructured grid. I have a velocity value for each of the points within the triangle. What I need to do is to interpolate the data from the centre of the triangle to the different node points, which would be my first set of coordinates. I've been trying to use griddata but keep getting error messages.
I'm not sure if I've explained myself very well but I've attached my code to this question so hopefully that will be clearer.

Respuesta aceptada

KSSV
KSSV el 6 de Sept. de 2016
Editada: Stephen23 el 6 de Sept. de 2016
As your data is unstructured, you can consider this data as scattered data. Why don't you use scatteredInterpolant? I have used this quite lot of times for unstructured grid and it worked perfectly for me.
More on:
  10 comentarios
Meghan
Meghan el 6 de Sept. de 2016
You are a life saver! I've been trying to figure this out all day!
Thanks so much :)
Meghan
Meghan el 7 de Sept. de 2016
Steven I wonder if you can help me. That method above does what I want when the v value is 79244x1. Can I use the same method if v is 79244x24x10? I've been fiddling with it this morning and haven't had much luck. I keep getting the error
Error using scatteredInterpolant
Input data point values have invalid dimension. The data must be specified in column-vector format.
I've introduced a z matrix so that the input is
XY3=scatteredInterpolant(uvX,uvY,mesh.uvdepth,u3,'linear');
Not sure if that is correct? Any advice?

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