Using griddata on an unstructured grid

26 vues (au cours des 30 derniers jours)
Meghan
Meghan le 6 Sep 2016
Commenté : Meghan le 7 Sep 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.

Réponse acceptée

KSSV
KSSV le 6 Sep 2016
Modifié(e) : Stephen23 le 6 Sep 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 commentaires
Meghan
Meghan le 6 Sep 2016
You are a life saver! I've been trying to figure this out all day!
Thanks so much :)
Meghan
Meghan le 7 Sep 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?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by