Clear Filters
Clear Filters

2D curves from scatter points

1 view (last 30 days)
ARF
ARF on 2 Dec 2016
Answered: Don Zheng on 8 Dec 2016
I have 2D points stored in a matrix. These points represents curves on a cartesian plane. If I plot these points as
plot(data(:,1),data(:,2),'.')
I can clearly see these curves, except for some spurious points.
Is there a way to save each curve in a separate variable? Note that the points in the matrix 'data' are stored randomly, i.e. following points belongs to different curves.
Thank you very much.

Answers (1)

Don Zheng
Don Zheng on 8 Dec 2016
Hi ARF,
My understanding of your question is that you want to separate the points in 'data' by their topological distribution (i.e., lying on the same curve). This process seems to fall into the concept of clustering. The Machine Learning toolbox is a powerful tool for clustering. A self-organizing map might be what you are looking for.
Also, based on the prio-knowledge about the curves, you may also use the following tool to perform fitting: https://www.mathworks.com/matlabcentral/fileexchange/40613-multiple-curve-fitting-with-common-parameters-using-nlinfit
Another approach that I can think of is a graphic approach. For example, imagine these points are pixel positions and assume the curves are straight lines. With that assumption, you can use HOUGH transform to find the lines as well as points following onto them.
Last but not least, you can try a manual approach. After plotting the points, in the figure window, click the Brush/Select Data icon, manually select the points that you think should fall into one group. Then, go to Tools > Brushing > Create new variable... and create a variable for those points. Do the same for each group (or curve) of data.

Products

Community Treasure Hunt

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

Start Hunting!