Finding Minimum Distance between two points
显示 更早的评论
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 个评论
KSSV
2016-10-27
Dear friend..there will be only fixed distance between two points. Think of your question once.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Nearest Neighbors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

