How to order a set of unordered points

20 ビュー (過去 30 日間)
sparsh garg
sparsh garg 2021 年 8 月 30 日
コメント済み: sparsh garg 2021 年 10 月 18 日
I have a set of unordered points,would appreciate it if some advice can be given on how to reorder them,so that when you draw a line plot the result is continous
Basically,i would like to apply the idea behind RRT.
In RRT,we randomly choose a point,and then find its closest neighbour.We then connect the start point to that neighbour and do tha till we reach the goal.
Given the below img,do you think that idea will work here.
Side note: I have already computed the nearest neigbours for all the points using this,and would appreciate it if we can combine my approach with the one I am talking about in this post.
For ref encosed is the unordered point image as well as the points file
https://in.mathworks.com/matlabcentral/answers/482865-finding-the-10-nearest-points-to-every-point-with-corresponding-distances-within-a-single-variable

採用された回答

Wan Ji
Wan Ji 2021 年 8 月 30 日
編集済み: Wan Ji 2021 年 8 月 30 日
Use boundary(x,y) function
load('pts.mat');
x=X_pts(:,1);
y = X_pts(:,2);
k = boundary(x,y,1);
plot(x(k),y(k))
set(gca,'YDir','reverse')
  7 件のコメント
Wan Ji
Wan Ji 2021 年 8 月 31 日
I have got some answer from others
See the attached files @sparsh garg
sparsh garg
sparsh garg 2021 年 10 月 18 日
Hey wan just wanted to thank you once more for taking the time out to help me.Really learned a lot from you.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetworks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by