%load fcmdata.dat
for i=1:20;for j=1:20;fcmdata(i,j)=rand(1);end;end
plot(fcmdata(:,1),fcmdata(:,2),'o')
[center,U,objFcn] = fcm(fcmdata,2);
figure
plot(objFcn)
title('Objective Function Values')   
xlabel('Iteration Count')
ylabel('Objective Function Value')
maxU = max(U);
index1 = find(U(1,:) == maxU);
index2 = find(U(2,:) == maxU);
figure
line(fcmdata(index1,1), fcmdata(index1,2), 'linestyle',...
                        'none','marker', 'o','color','g')
line(fcmdata(index2,1),fcmdata(index2,2),'linestyle',...
                        'none','marker', 'x','color','r')
hold on
plot(center(1,1),center(1,2),'ko','markersize',15,'LineWidth',2)
plot(center(2,1),center(2,2),'kx','markersize',15,'LineWidth',2)