Fuzzy Logic Toolbox    

Customizing Your Fuzzy System

If you want to include customized functions as part of your use of the Fuzzy Logic Toolbox, there are a few guidelines you need to follow. The AND method, OR method, aggregation method, and defuzzification method functions you provide need to work in a similar way to max, min, or prod in MATLAB. That is, they must be able to operate down the columns of a matrix. For example, the implication method does an element by element matrix operation, similar to the min function, as in

Custom Membership Functions

You can create your own membership functions using an M-file. The values these functions can take must be between 0 and 1. There is a limitation on customized membership functions in that they cannot use more than 16 parameters.

To define a custom membership function named custmf:

  1. Create an M-file for a function, custmf.m, that takes values between 0 and 1, and depends on at most 16 parameters.
  2. Choose the Add Custom MF item in the Edit menu on the Membership Function Editor GUI.
  3. Enter your custom membership function M-file name, custmf, in the M-file function name text box.
  4. Enter the vector of parameters you want to use to parameterize your customized membership function in the text box next to Parameter list.
  5. Give the custom membership function a name different from any other membership function name you will use in your FIS.
  6. Select OK.

Here is some sample code for a custom membership function, testmf1, that depends on eight parameters between 0 and 10.

You can try naming this file testmf1.m and loading it into the Membership Function Editor using the parameters of your choice.


 Importing and Exporting from the GUI Tools Working from the Command Line