Clustered 3D scatterplot with kmeans
2 ビュー (過去 30 日間)
古いコメントを表示
hi,
I have a set of xyz,
and i want to plot the scatterplot of 3D data with clustering and then i want to find the mean of each clustered data by k-means
I wrote the code below but it is not working. it is for 150 cluster. What will be the problem. I think the problem is about "scatter3(xyz(:,1),xyz(:,2),xyz(:,3), idx,'bgm')"
Thank you
x=xlsread('kesit3D.xlsx', 'A:A');
y=xlsread('kesit3D.xlsx', 'B:B');
z=xlsread('kesit3D.xlsx', 'C:C');
xyz=[x y z];
[idx,C] = kmeans(xyz,150);
figure
scatter3(xyz(:,1),xyz(:,2),xyz(:,3), idx,'bgm')
hold on
plot(C(:,1),C(:,2),C(:,3),'kx')
disp(C)
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Cluster Analysis and Anomaly Detection についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!