Clustered 3D scatterplot with kmeans
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Cluster Analysis and Anomaly Detection en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!