Fuzzy Logic Tool Box in Matlab 1, Exercises of Artificial Intelligence

examples of fuzzy logic using matlab tool box

Typology: Exercises

2018/2019

Uploaded on 05/06/2019

waed.ce
waed.ce 🇸🇾

3 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Fuzzy Logic Toolbox
An Example: Two Lines
To see a specific example of a system with linear output membership functions, consider the one input one output system stored in sugeno1.fis.
fismat = readfis('sugeno1');
getfis(fismat,'output',1)
Name = output
NumMFs = 2
MFLabels =
line1
line2
Range = [0 1]
The output variable has two membership functions.
getfis(fismat,'output',1,'mf',1)
Name = line1
Type = linear
Params =
-1 -1
getfis(fismat,'output',1,'mf',2)
Name = line2
Type = linear
Params =
1 -1
Further, these membership functions are linear functions of the input variable. The membership function line1 is defined by the equation
output = (-1)*input + (-1)
and the membership function line2 is defined by the equation
output = (1)*input + (-1)
The input membership functions and rules define which of these output functions will be expressed and when.
showrule(fismat)
ans =
1. If (input is low) then (output is line1) (1)
2. If (input is high) then (output is line2) (1)
The function plotmf shows us that the membership function low generally refers to input values less than zero, while high refers to values greater than zero. The
function gensurf shows how the overall fuzzy system output switches smoothly from the line called line1 to the line called line2.
subplot(2,1,1), plotmf(fismat,'input',1)
subplot(2,1,2),gensurf(fismat)
This is just one example of how a Sugeno-type system gives you the freedom to incorporate linear systems into your fuzzy systems. By extension, you could
build a fuzzy system that switches between several optimal linear controllers as a highly nonlinear system moves around in its operating space.
Sugeno-Type Fuzzy Inference Conclusion

Partial preview of the text

Download Fuzzy Logic Tool Box in Matlab 1 and more Exercises Artificial Intelligence in PDF only on Docsity!

Fuzzy Logic Toolbox

An Example: Two Lines

To see a specific example of a system with linear output membership functions, consider the one input one output system stored in sugeno1.fis.

fismat = readfis('sugeno1'); getfis(fismat,'output',1) Name = output NumMFs = 2 MFLabels = line line Range = [0 1]

The output variable has two membership functions.

getfis(fismat,'output',1,'mf',1) Name = line Type = linear Params = -1 - getfis(fismat,'output',1,'mf',2) Name = line Type = linear Params = 1 -

Further, these membership functions are linear functions of the input variable. The membership function line1 is defined by the equation

output = (-1)* input + (-1)

and the membership function line2 is defined by the equation

output = (1)* input + (-1)

The input membership functions and rules define which of these output functions will be expressed and when.

showrule(fismat) ans =

  1. If (input is low) then (output is line1) (1)
  2. If (input is high) then (output is line2) (1)

The function plotmf shows us that the membership function low generally refers to input values less than zero, while high refers to values greater than zero. The

function gensurf shows how the overall fuzzy system output switches smoothly from the line called line1 to the line called line2.

subplot(2,1,1), plotmf(fismat,'input',1) subplot(2,1,2),gensurf(fismat)

This is just one example of how a Sugeno-type system gives you the freedom to incorporate linear systems into your fuzzy systems. By extension, you could

build a fuzzy system that switches between several optimal linear controllers as a highly nonlinear system moves around in its operating space.

Sugeno-Type Fuzzy Inference Conclusion