Effacer les filtres
Effacer les filtres

2D interpolation of scattered data

4 vues (au cours des 30 derniers jours)
Senal Perera
Senal Perera le 22 Jan 2021
Commenté : Senal Perera le 22 Jan 2021
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.

Réponse acceptée

KSSV
KSSV le 22 Jan 2021
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 commentaire
Senal Perera
Senal Perera le 22 Jan 2021
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.

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