2D interpolation of scattered data

4 ビュー (過去 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 Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by