Cluster analysis in Matlab. Count total number of cluster in the text file.
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2019-9-11
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().
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!