Finding Minimum Distance between two points
Show older comments
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 Comment
KSSV
on 27 Oct 2016
Dear friend..there will be only fixed distance between two points. Think of your question once.
Accepted Answer
More Answers (0)
Categories
Find more on Nearest Neighbors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
