Hi guys, I using the code bellow to extract 3 columns data from an Excel file and cluster it using K-means. I am having trouble however in the analysis part. After I cluster, I get a response from Matlab with the Index number of the cluster for each line in my file, but I am not sure how to use it in order to make the analysis itself.
Example: I want to do a "Histogram" analysis using the fuction "histogram"only in the cluster number 2. How can I do that?
Thanks in Advance !
imp = xlsread('Academia.xlsx')%Testes de quantidade de clusters:
eva = evalclusters(imp, 'kmeans', 'CalinskiHarabasz','Klist',[1:15])eva2 = evalclusters(imp, 'kmeans', 'Silhouette','Klist',[1:15])eva3 = evalclusters(imp, 'kmeans', 'DaviesBouldin','Klist',[1:15])subplot(2,2,1)plot(eva)title('CalinskiHarabasz')subplot(2,2,2)plot(eva2)title('Silhouette')subplot(2,2,3)plot(eva3)title('DaviesBouldin')%Rodar Kmeans
[idx,C]=kmeans(imp,4)%Plotagem de gráficos:
[numInst,numDims] = size(imp);%# show points and clusters (color-coded)
clr = lines(4);figure, hold onscatter3(imp(:,1), imp(:,2), imp(:,3), 36, clr(idx,:), 'Marker','.')scatter3(C(:,1), C(:,2), C(:,3), 100, clr, 'Marker','o', 'LineWidth',3)hold offview(3), axis vis3d, box on, rotate3d onxlabel('flexibilidade'), ylabel('velocidade'), zlabel('forca')
Best Answer