Interpolate scattered values on a regular grid with bi-harmonic interpolation method

Hi mates.
I've got an vector with values and Corresponding x, y vectors.
I would like to interpolate values in an entire study area.
This is my approach:
reservoir(:,1) is the Vector with the x-Values, reservoir(:,2) contains y-Values. '"y" is the vector with the actual measured values at the coordinates.
honestly, I don't know, what 'v4' stands for.
That's, what I get:
And I don't know why.
Any guesses or tips?
Best regrades
Felix

답변 (1개)

Create appropriate mesh
x = linspace(min(reservoir(:,1)),max(reservoir(:,1)),20);
y = linspace(min(reservoir(:,2)),max(reservoir(:,2)),20);
[X,Y] = meshgrid(x,y);
Z = griddata(reservoir(:,1),reservoir(:,2),y,X,Y);
surf(X,Y,Z)

댓글 수: 3

Thank you, that worked. It worked defently in another way as i should do it, but I think thats fine.
Because I'm not realy into it, would it be posible, that you shortly explain to me what did you do?
What is linspace for?
Best
Felix
YOu have wrong mesh (surface) because the data is not ordered. Or you create new mesh (as i did) or you order the data
[XI,YI] = meshgrid(sort(reservoir(:,1)),sort(reservoir(:,2)));
got it. Thank you.
Best regrades and have a nice time.
Felix Roth

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

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2021년 8월 14일

댓글:

2021년 8월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by