Clustered 3D scatterplot with kmeans

6 ビュー (過去 30 日間)
Mehmet Volkan Ozdogan
Mehmet Volkan Ozdogan 2019 年 3 月 22 日
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 件)

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by