用调整后的中心点再次进行聚类,得到第二次迭代后的结果仍为:中国C,日本A,韩国A,伊朗A,沙特A,伊拉克C,卡塔尔C,阿联酋C,乌兹别克斯坦B,泰国C,越南C,阿曼C,巴林B,朝鲜B。
结果无变化,说明结果已收敛。于是,最终聚类结果为:
亚洲一流:日本,韩国,伊朗,沙特
亚洲二流:乌兹别克斯坦,巴林,朝鲜
亚洲三流:中国,伊拉克,卡塔尔,阿联酋,泰国,越南,阿曼
六、代码实现
>> a=[1,1,0.5;0.3,0,0.19;0,0.15,0.13;0.24,0.76,0.25;0.3,0.76,0.06;1,1,0;1,0.76,0.5;1,0.76,0.5;0.7,0.76,0.25;1,1,0.5;1,1,0.25;1,1,0.5;0.7,0.76,0.5;0.7,0.68,1;1,1,0.5] a = 1.0000 1.0000 0.5000 0.3000 0 0.1900 0 0.1500 0.1300 0.2400 0.7600 0.2500 0.3000 0.7600 0.0600 1.0000 1.0000 0 1.0000 0.7600 0.5000 1.0000 0.7600 0.5000 0.7000 0.7600 0.2500 1.0000 1.0000 0.5000 1.0000 1.0000 0.2500 1.0000 1.0000 0.5000 0.7000 0.7600 0.5000 0.7000 0.6800 1.0000 1.0000 1.0000 0.5000 >> ind=[2,13,10] ind = 2 13 10 >> b=a(ind(:),:) b = 0.3000 0 0.1900 0.7000 0.7600 0.5000 1.0000 1.0000 0.5000 result = 1.2594 0.3842 0 0 0.9131 1.2594 0.3407 0.9995 1.3636 0.7647 0.5235 0.8353 0.7710 0.5946 0.8609 1.2354 0.6306 0.5000 1.0787 0.3000 0.2400 1.0787 0.3000 0.2400 0.8609 0.2500 0.4584 1.2594 0.3842 0 1.2221 0.4584 0.2500 1.2594 0.3842 0 0.9131 0 0.3842 1.1307 0.5064 0.6651 1.2594 0.3842 0