Finding the 2 closest coordinates for a point
이전 댓글 표시
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
darova
2019년 6월 29일
What about pdist2?
hrushikesh kyathari
2019년 6월 29일
darova
2019년 6월 29일
try
[D,I] = pdist2(X,Y,'euclidean','Smallest',1);
hrushikesh kyathari
2019년 6월 29일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Univariate Discrete Distributions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!