how to change fuzzy sub cluster code to kmeans
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
A=xlsread('APNORM.xlsx',5,'J12:M41');
B=xlsread('APNORM.xlsx',5,'P12:S41');
C=[A;B];
[Co,S,L] = pca(C);
S=S(:,1:2);
[C,b] = subclust(S,0.9);
scatter(S(1:30,1),S(1:30,2),'ob');
hold on
scatter(S(31:60,1),S(31:60,2),'or');
scatter(C(:,1),C(:,2),'dm');
xlabel('PC1');
ylabel('PC2');
legend('Normal','Hipoksemia','Titik Tengah Klaster');
0 Kommentare
Antworten (1)
Anay
am 19 Feb. 2025
Hi Maria,
I understand that you are trying to use k-means clustering instead of subtractive clustering. To achieve this, you can use the “kmeans” function instead of the “subclust” function to use k-means algorithm for clustering.
Note that you need to specify number of clusters as input to the “kmeans” function.
You can refer to the documentation of the “kmeans” function by using the following command in the Command Window of MATLAB:
>>doc kmeans
Hope this helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!