Finding the 2 closest coordinates for a point

3 ビュー (過去 30 日間)
hrushikesh kyathari
hrushikesh kyathari 2019 年 6 月 29 日
回答済み: darova 2019 年 6 月 29 日
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 件のコメント
hrushikesh kyathari
hrushikesh kyathari 2019 年 6 月 29 日
Thanks a lot!
Adam Danz
Adam Danz 2019 年 6 月 29 日
You should copy your comment as an answer, darova. That way the problem will be marked as ansered and you can get credit for your good answer.

サインインしてコメントする。

採用された回答

darova
darova 2019 年 6 月 29 日
[D,I] = pdist2(X,Y,'euclidean','Smallest',1);
Im gonna be MVP (Most Valueble Person), maybe MathWorks will start to pay me. Accept my answer please

その他の回答 (0 件)

タグ

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by