31.10.2014 Views

What Is Fuzzy Logic?

What Is Fuzzy Logic?

What Is Fuzzy Logic?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2 Tutorial<br />

Finally, plot the two cluster centers found by the fcm function using the<br />

following code:<br />

maxU = max(U);<br />

index1 = find(U(1, :) == maxU);<br />

index2 = find(U(2, :) == maxU);<br />

figure<br />

line(fcmdata(index1, 1), fcmdata(index1, 2), 'linestyle',...<br />

'none','marker', 'o','color','g');<br />

line(fcmdata(index2,1),fcmdata(index2,2),'linestyle',...<br />

'none','marker', 'x','color','r');<br />

hold on<br />

plot(center(1,1),center(1,2),'ko','markersize',15,'LineWidth',2)<br />

plot(center(2,1),center(2,2),'kx','markersize',15,'LineWidth',2)<br />

Note Every time you run this example, the fcm function initializes with<br />

different initial conditions. This behavior swaps the order in which the cluster<br />

centers are computed and plotted.<br />

2-146

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!