首页 > 解决方案 > 在 Matlab 中绘制 FCM 簇

问题描述

我可以将 2 个集群可视化为此链接中的示例:

在这种情况下,如何可视化 3 或 4 个集群?每个集群都有一个中心,这些集群有不同的颜色。

我已经尝试过了,但不能将 3 个集群放在 3 种不同的颜色中:

figure
plot(fcmdata(:,1),fcmdata(:,2),'o')
line(fcmdata(index1,1), fcmdata(index1,2), 'linestyle',...
                        'none','marker', 'o','color','g')
                    plot(fcmdata(:,1),fcmdata(:,2),'o')
                    hold on
line(fcmdata(index2,1),fcmdata(index2,2),'linestyle',...
                        'none','marker', 'o','color','r')
plot(fcmdata(:,1),fcmdata(:,2),'o')
hold on
line(fcmdata(index3,1),fcmdata(index3,2),'linestyle',...
                        'none','marker', 'o','color','b')

%line(fcmdata(index4,1),fcmdata(index4,2),'linestyle',...
                       % 'none','marker', 'o','color','c')

 hold on
plot(center(1,1),center(1,2),'kx','markersize',15,'LineWidth',2)
plot(center(2,1),center(2,2),'kx','markersize',15,'LineWidth',2)
plot(center(3,1),center(3,2),'kx','markersize',15,'LineWidth',2)

我想念什么吗?我在哪里可以更改代码以 3 种不同颜色绘制 3 个集群?

标签: matlabcluster-analysis

解决方案


推荐阅读