Find clusters within a set of 3D points

12 views (last 30 days)
Sriniwasan
Sriniwasan on 9 Jun 2014
Answered: Tom Lane on 17 Jun 2014
Hello;
I have looked at kmeans but it doesn't quite solve what I am looking for:
I have an excel file with 3D coordinates of around 7,000 points.
I'm trying to find clusters of points within a threshold distance. I do not know ahead of time how many clusters there will be. Ideally, I would be able to count the number of 3 point clusters that fit my distance criteria. Points can be a part of multiple clusters as long as they fit the criteria. Does anyone have a suggestion as to how I could do this with MATLAB?

Answers (1)

Tom Lane
Tom Lane on 17 Jun 2014
To find points within a threshold distance, try the rangesearch function from the Statistics Toolbox.
If you want three-point clusters, one thing you could try is to use knnsearch to find the three closest points to each point. Pass the same array as the first two inputs to this function. Presumably the closest three will consist of the point itself plus the closest two other points.

Community Treasure Hunt

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

Start Hunting!