필터 지우기
필터 지우기

Using griddata on an unstructured grid

조회 수: 9 (최근 30일)
Meghan
Meghan 2016년 9월 6일
댓글: Meghan 2016년 9월 7일
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.

채택된 답변

KSSV
KSSV 2016년 9월 6일
편집: Stephen23 2016년 9월 6일
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
Meghan
Meghan 2016년 9월 6일
You are a life saver! I've been trying to figure this out all day!
Thanks so much :)
Meghan
Meghan 2016년 9월 7일
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?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by