Fuzzy Logic Toolbox | ![]() ![]() |
The Membership Function Editor
The Membership Function Editor shares some features with the FIS Editor. In fact, all of the five basic GUI tools have similar menu options, status lines, and Help and Close buttons. The Membership Function Editor is the tool that lets you display and edit all of the membership functions associated with all of the input and output variables for the entire fuzzy inference system.
When you open the Membership Function Editor to work on a fuzzy inference system that does not already exist in the workspace, there are not yet any membership functions associated with the variables that you have just defined with the FIS Editor.
On the upper left side of the graph area in the Membership Function Editor is a "Variable Palette" that lets you set the membership functions for a given variable.To set up your membership functions associated with an input or an output variable for the FIS, select an FIS variable in this region by clicking on it.
Next select the Edit
pull-down menu, and choose Add MFs....
A new window will appear, which allows you to select both the membership function type and the number of membership functions associated with the selected variable. In the lower right corner of the window are the controls that let you change the name, type, and parameters (shape), of the membership function, once it has been selected.
The membership functions from the current variable are displayed in the main graph. These membership functions can be manipulated in two ways. You can first use the mouse to select a particular membership function associated with a given variable quality, (such as poor, for the variable, service), and then drag the membership function from side to side. This will affect the mathematical description of the quality associated with that membership function for a given variable. The selected membership function can also be tagged for dilation or contraction by clicking on the small square drag points on the membership function, and then dragging the function with the mouse toward the outside, for dilation, or toward the inside, for contraction. This will change the parameters associated with that membership function.
Below the Variable Palette is some information about the type and name of the current variable. There is a text field in this region that lets you change the limits of the current variable's range (universe of discourse) and another that lets you set the limits of the current plot (which has no real effect on the system).
The process of specifying the input membership functions for this two input tipper problem is as follows:
service
, by double-clicking on it. Set both the Range
and the Display Range
to the vector [0 10].
Add MFs...
from the Edit
menu. The window below pops open
for Number of MFs. This adds three Gaussian curves to the input variable service.
poor
. To adjust the shape of the membership function, either use the mouse, as described above, or type in a desired parameter change, and then click on the membership function. The default parameter listing for this curve is [1.5 0]
.
good
, and the curve with the rightmost hump, excellent
. Reset the associated parameters if desired.
Range
and the Display Range
to the vector [0 10]
.
Add MFs...
from the Edit
menu and add two trapmf
curves to the input variable food
.
rancid
. To adjust the shape of the membership function, either use the mouse, as described above, or type in a desired parameter change, and then click on the membership function. The default parameter listing for this curve is [0 0 1 3]
.
delicious
, and reset the associated parameters if desired.
Next you need to create the membership functions for the output variable, tip. To create the output variable membership functions, use the Variable Palette on the left, selecting the output variable, tip. The inputs ranged from 0 to 10, but the output scale is going to be a tip between 5 and 25 percent.
Use triangular membership function types for the output. First, set the Range
(and the Display Range
) to [0 30]
, to cover the output range. Initially, the cheap membership function will have the parameters [0 5 10]
, the average membership function will be [10 15 20
], and the generous membership function will be [20 25 30
]. Your system should look something like this.
Now that the variables have been named, and the membership functions have appropriate shapes and names, you're ready to write down the rules. To call up the Rule Editor, go to the View
menu and select Edit Rules...
, or type ruleedit
at the command line.
![]() | The FIS Editor | The Rule Editor | ![]() |