Finding the 2 closest coordinates for a point
Mostra commenti meno recenti
I have got a 30 points in the set [-0.5,0.5]^2 in a matrix R generated from the random function. For each point, I need to find the 2 nearest points as well as the row number of the points. What should be done?
5 Commenti
darova
il 29 Giu 2019
What about pdist2?
hrushikesh kyathari
il 29 Giu 2019
darova
il 29 Giu 2019
try
[D,I] = pdist2(X,Y,'euclidean','Smallest',1);
hrushikesh kyathari
il 29 Giu 2019
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Univariate Discrete Distributions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!