Beruflich Dokumente
Kultur Dokumente
Objective
Workingwiththefunctions
Exercise 1
Exercise 2
Exercise 3
Fuzzysystems in Simulink
Exercise 4
Each work team will create a directory named representatively, in which to save all
the results from the exercises (Matlab scripts and a Word file with the numerical
and graphical results).
Objective
Getting used to the functions and graphical interfaces of Fuzzy Logic Toolbox
in Matlab/Simulink
Membershipfunctions
Advancedtechniques
Miscellaneousfunctions
In order to visualize the available functions and graphical interfaces in Matlab, type
the following in the command line:
close all% close all open windows
Explore the information given by Matlab about working with this function
Exercise 1
Run the example presented in the "trimf" function help. Use "copy and paste" for
the entire sequence. Analyze what happens, line by line.
Remember: you can always use "help [function_name]" to view details about any
function.
Exercise 2
Re - run Exercise 1 for any other function in the "Membership functions" group.
Launching the graphical editor for creating a FLS
Type the following in the command line:
fuzzy
Exercise 3
Import an existing FLS in the graphical editor, namely the FLS for computing the tip
for a meal at the restaurant. Followthesesteps:
from the graphical editor, go to "File -> Import -> From file..." and select
"tip.fis".
who
Your variables are:
tip
Use the following command to see the properties of the fuzzy system:
getfis(tip)
Name
= tip
Type
= mamdani
NumInputs = 2
InLabels =
service
food
NumOutputs = 1
OutLabels =
tip
NumRules = 3
AndMethod = min
OrMethod = max
ImpMethod = min
AggMethod = max
DefuzzMethod = centroid
ans =
tip
Use the following command to display the control surface generated by the fuzzy
system:
gensurf(tip)
Use "newfis" to create a new fuzzy system. For additional information, type:
help newfis
NEWFIS Create new FIS.
FIS=NEWFIS(FISNAME) creates a new Mamdani-style FIS structure
FIS=NEWFIS(FISNAME, FISTYPE) creates a FIS structure for a Mamdani or
Sugeno-style system with the name FISNAME.
FIS=NEWFIS(FISNAME, FISTYPE, andMethod, orMethod, impMethod, ...
aggMethod, defuzzMethod)
specifies the methods for AND, OR, implication, aggregation, and
defuzzification, respectively.
See Also
readfis, writefis
Kelly Liu 4-5-96
Copyright 1994-2003 The MathWorks, Inc.
$Revision: 1.18.2.2 $ $Date: 2004/04/10 23:15:32 $
Reference page in Help browser
doc newfis
Themodelconsists of:
two constant value blocks, for the two input variables ("food" and "service")
To run the model, press the "Run" button from the toolbar, or type the following
command:
sim('tip_sim.mdl');
Exercise 4
Change the values for "food" and/or "service", and notice how they influence the
value of the tip.
Note: the values for "food" and "service" must be between 0 and 10.
Use the mouse to modify the values for "food" and "service" from the rule viewer
window. The value of the tip will change consequently.
The control surface (graphical representation of the output variable (tip) as a
function of the two input variables (service, food)) generated by the FLS can be
displayed.
To that effect, form the Rule Viewer window use the menu "View - Surface".