The Graph of Clustering Looks Messy, Why?
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm working with k-means. And this is the graph of mine.
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
It looks messy. The red and blue are mixed. What do you think? It is because the file I used? Or the clustering isn't working properly?
Here is my code...
load cobat.txt
k=input('Enter a number: ');
% CLUSTER (PUSH BUTTON)
[g c] = kmeans(cobat,k,'dist','SqEuclidean');
y = [cobat g]
% SHOW THE GRAPHIC
%# show points and clusters (color-coded)
clr = lines(k);
figure, hold on
scatter3(cobat(:,1), cobat(:,2), cobat(:,3), 36, clr(g,:), 'Marker','.')
scatter3(c(:,1), c(:,2), c(:,3), 100, clr, 'Marker','o', 'LineWidth',3)
hold off
view(3), axis vis3d, box on, rotate3d on
xlabel('x'), ylabel('y'), zlabel('z')
댓글 수: 0
채택된 답변
Image Analyst
2013년 5월 10일
Maybe you just need to rotate the volume so that you're looking at it from a better viewpoint - one that doesn't have so many things overlapping.
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!