Clustered 3D scatterplot with kmeans
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Cluster Analysis and Anomaly Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!