31.10.2014 Views

What Is Fuzzy Logic?

What Is Fuzzy Logic?

What Is Fuzzy Logic?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Working from the Command Line<br />

Specifying Custom Membership and Inference Functions<br />

You can create custom membership and inference functions as described in<br />

“Specifying Custom Membership Functions” on page 2-60, and “Specifying<br />

Custom Inference Functions” on page 2-66, and specify them for building<br />

fuzzy inference systems at the command line.<br />

To include a custom membership function, specify the name of the custom<br />

membership function, as shown in the following example:<br />

a=addmf(a,'input',1,'customMF1','custmf1',[0 1 2 4 6 8 9 10]);<br />

To include a custom inference function, specify the name of the custom<br />

inference function, as shown in the following example:<br />

a.defuzzMethod='customdefuzz';<br />

FIS Evaluation<br />

To evaluate the output of a fuzzy system for a given input, use the function<br />

evalfis. For example, the following script evaluates tipper at the input,<br />

[1 2].<br />

a = readfis('tipper');<br />

evalfis([1 2], a)<br />

ans =<br />

5.5586<br />

This function can also be used for multiple collections of inputs, because<br />

different input vectors are represented in different parts of the input<br />

structure.<br />

evalfis([3 5; 2 7], a)<br />

ans =<br />

12.2184<br />

7.7885<br />

The FIS Structure<br />

The FIS structure is the MATLAB object that contains all the fuzzy inference<br />

system information. This structure is stored inside each GUI tool. Access<br />

functions such as getfis and setfis make it easy to examine this structure.<br />

2-81

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

Saved successfully!

Ooh no, something went wrong!