Cluster analysis in Matlab. Count total number of cluster in the text file.

1 view (last 30 days)
Respected MATLAB experts,
I seek advice in cluster analysis. I have thousands of frames of data similar to attached Frame1.txt. I need to count the total number of clusters, I need to write code to make sure that MATLAB identifies each cluster as a cluster, and exports each cluster in a square matrix so that I can do pattern recognition on that.
Could you please provide me any advice or examples on how to achieve this? What literature I look into?
Any insight is hugely appreciated.
To parse my data I use this:
ind=zeros(256, 256);
tic
lines = readmatrix('C:\Users\sanchitsharma\Desktop\MATLABscripts\ADVANCED\1mm_300V_15ko\Frame1.txt');
ind = lines';
toc
Thanks in advance!
-Sanchit
  3 Comments
Sanchit Sharma
Sanchit Sharma on 11 Sep 2019
I understand, well here are the properties:
1) Non zero quantities clubbed together is one cluster.
2) There are also special cases see atached figure. The yellow encircled are one cluster each.
Please let me know the idea or how to approach this problem.
Thanks!
Walter Roberson
Walter Roberson on 11 Sep 2019
If you look at the upper right part of your clust, there are two areas circled in yellow. Between them is a pair of blobs grouped together with a small distance between them. At the moment I do not see any rule that would clearly distinguish that non-special pair from the special pair to the upper right of it ?
My thought would be to logical() the data (that is, true for all non-zero values), then https://www.mathworks.com/help/images/ref/imclose.html imclose() to merge close blobs, followed by one of the blob detecting routines such as bwlabel() or regionprops().

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!