码迷,mamicode.com
首页 > 其他好文 > 详细

初步学习之FCM

时间:2015-05-11 23:40:02      阅读:318      评论:0      收藏:0      [点我收藏+]

标签:

先贴代码:

data = rand(100,2);
       [center,U,obj_fcn] = fcm(data,2);
      plot(data(:,1), data(:,2),‘o‘);
      hold on;
       maxU = max(U);
     % Find the data points with highest grade of membership in cluster 1
      index1 = find(U(1,:) == maxU);
   % Find the data points with highest grade of membership in cluster 2
      index2 = find(U(2,:) == maxU);          line(data(index1,1),data(index1,2),‘marker‘,‘*‘,‘color‘,‘g‘);
      line(data(index2,1),data(index2,2),‘marker‘,‘*‘,‘color‘,‘r‘);
       Plot the cluster centers
       plot([center([1 2],1)],[center([1 2],2)],‘*‘,‘color‘,‘k‘)
      hold off;

这是help FCM函数得到的例子。

 

技术分享

技术分享

初步学习之FCM

标签:

原文地址:http://www.cnblogs.com/natalie/p/4495673.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!