How to Rearrange Circular Data Sequentially
显示 更早的评论
My data plots as follows:

The data jumps from bottom end to top end, back and forth, creating jagged lines in the line-plot.
What I want to happen (I created a mock-up) is:

Where the each successive data point in the closest distance-wise to the previous point. I assume I would have to loop through all points and check which is the closest in euclidean space and go to the next point.
I'm a beginner with MATLAB and I'm having trouble implementing this and any help is appreciated.
My data is attached to the post.
采纳的回答
更多回答(2 个)
the cyclist
2015-3-11
What command are you using to make the plot? It is defaulting to putting in a connecting line, but do you really need that at all? Maybe you could just use the X's, such as
plot(X,Y,'.')
or
scatter(X,Y)
the cyclist
2015-3-11
0 个投票
You could calculate the four-quadrant inverse tangent of your X,Y coordinates, sort them in that order, and plot them as you did in your example.
类别
在 帮助中心 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
