Finding Minimum Distance between two points
Afficher commentaires plus anciens
Hi, I am trying to make a function to find minimum distance between my random points and a point (0,0) and plot the distance as a line crossing from the (0,0) to the one of the closest rand pt.
A=rand(2,10);
x1=A(1,:);
y1=A(2,:);
scatter(x1,y1);
[D I] = pdist2(x1,y1,'euclidean')
I have been trying to use 'pdist2' with 'euclidean' function however, it is not working well. :O
1 commentaire
KSSV
le 27 Oct 2016
Dear friend..there will be only fixed distance between two points. Think of your question once.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Nearest Neighbors dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

