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.

2 Tutorial<br />

Specifying Custom Membership Functions<br />

You can create custom membership functions, and use them in the fuzzy<br />

inference process. The values of these functions must lie between 0 and<br />

1. You must save the custom membership functions as M-files in your<br />

current working directory. To learn how to build fuzzy systems using custom<br />

membership functions, see “How to Build <strong>Fuzzy</strong> Inference Systems Using<br />

Custom Functions in the GUI” on page 2-58.<br />

To create a custom membership function, and replace the built-in membership<br />

function:<br />

1 Create a MATLAB function, and save it as an M-file in your current<br />

working directory.<br />

To learn how to create MATLAB functions, see the “Functions and Scripts”<br />

section in the MATLAB documentation.<br />

The following code is an example of a multi-step custom membership<br />

function, custmf1, that depends on eight parameters between 0 and 10.<br />

% Function to generate a multi-step custom membership function<br />

% using 8 parameters for the input argument x<br />

function out = custmf1(x, params)<br />

for i=1:length(x)<br />

if x(i)

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

Saved successfully!

Ooh no, something went wrong!