Finding Minimum Distance between two points
Ältere Kommentare anzeigen
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 Kommentar
KSSV
am 27 Okt. 2016
Dear friend..there will be only fixed distance between two points. Think of your question once.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Nearest Neighbors finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

