0% found this document useful (0 votes)
174 views

Tutorial On Fuzzy Logic Using MATLAB

This tutorial document outlines using MATLAB's Fuzzy Logic Toolbox to model a tipping problem. It introduces the toolbox and FIS Editor, then uses a example where restaurant service quality and food quality are inputs to determine the tip amount output. Membership functions are defined for the inputs and output, and fuzzy rules are created to relate the inputs to the appropriate tipping outcome.

Uploaded by

saeedhoseini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views

Tutorial On Fuzzy Logic Using MATLAB

This tutorial document outlines using MATLAB's Fuzzy Logic Toolbox to model a tipping problem. It introduces the toolbox and FIS Editor, then uses a example where restaurant service quality and food quality are inputs to determine the tip amount output. Membership functions are defined for the inputs and output, and fuzzy rules are created to relate the inputs to the appropriate tipping outcome.

Uploaded by

saeedhoseini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Tutorial on Fuzzy Logic using MATLAB

Adel Abdennour, Electrical Engineering Department, King Saud University

Outline
Fuzzy Logic Toolbox
FIS Editor Tipping Problem: Fuzzy Approach

Defining Inputs & Outputs


Defining MFs Defining Fuzzy Rules

MATLAB: Fuzzy Logic Toolbox

MATLAB: Fuzzy Logic Toolbox

FIS Editor

Tipping Problem
Given a number between 0 and 10 that represents the quality

of service at a restaurant (where 10 is excellent), and another number between 0 and 10 that represents the quality of the food at that restaurant (again, 10 is excellent), what should the tip be?
Assume that an average tip is 15%, a generous tip is 25%, and a

cheap tip is 5%.

Tipping Problem: Fuzzy Approach


Antecedent Service Food
Consequent Tip Membership Function Service : poor , good, excellent Food : rancid, delicious Tip : cheap, average, generous

FIS Editor: Adding Input / Output

Tipping Problem: Defining Input & outputs

Tipping Problem: Membership Function


Membership Function: Service
Let, Poor : 0-5 Good : 2.5 7.5 Excellent : 5- 10

Tipping Problem: Membership Function

Tipping Problem: Membership Function


Membership

Function:

Tip Let,
Cheap

: 0 - 15 Average : 7.5 22.5 Generous : 15 - 30

13

Tipping Problem: Fuzzy Rules


What we want to express is:
Rancid Poor Good Excellent Cheap Cheap Generous Delicious Average Average Generous

or
1. 2. 3. 4. 5.

If service is poor and the food is rancid then tip is cheap If service is good and the food is rancid then tip is cheap If service is poor and the food is delicious then tip is Average If service is good and the food is delicious then tip is Average If service is excellent then tip is generous

We have just defined the rules for a fuzzy logic system.

Tipping Problem: Fuzzy Rules

Tipping Problem: Fuzzy Rules

Saving FIS

Rule Viewer

Surface Viewer

You might also like