2D interpolation of scattered data

조회 수: 2 (최근 30일)
Senal Perera
Senal Perera 2021년 1월 22일
댓글: Senal Perera 2021년 1월 22일
x = [1 2 3 4 5];
y = [1 2 3 4 5];
z = [1 2 1 2 3; 3 4 3 4 5; 5 6 5 6 7; 3 4 3 4 5; 1 2 1 2 3];
Hi,
Is there a method to get the value of x as the output when the inputs are y = 2.5 and z = 4.5.
Where X is a 1*5 matrix, Y is a 1*5 matrix and Z is a 5*5 matrix as shown above.
Thanks in advance.

채택된 답변

KSSV
KSSV 2021년 1월 22일
x = [1 2 3 4 5];
y = [1 2 3 4 5];
z = [1 2 1 2 3; 3 4 3 4 5; 5 6 5 6 7; 3 4 3 4 5; 1 2 1 2 3];
[X,Y] = meshgrid(x,y) ;
idx = knnsearch([Y(:) z(:)],[2.5,4.5])
  댓글 수: 1
Senal Perera
Senal Perera 2021년 1월 22일
Thank you so much man. You are the best. Since the issue is solved, I can continue with the rest of my project. Thanks again.

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

추가 답변 (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