





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Fuzzy Logic and Neural Network Lab mannual
Typology: Study notes
1 / 37
This page cannot be seen from the preview
Don't miss anything!






























B.E (CSE)
VII - SEMESTER
ANNAMALAI UNIVERSITY
FACULTY OF ENGINEERING AND TECHNOLOGY
BONAFIDE CERTIFICATE
Ex. No: 1 Date:
Aim : To write a Program in MATLAB to perform union, intersection and complement operations of fuzzy set.
Algorithm:
Program:
% Enter the membership value of fuzzy set
u = input (‘Enter the membership value of First Fuzzy set’);
v = input (‘Enter the membership value of Second Fuzzy set’);
%performs Union, Intersection and Complement operations
w=max (u, v);
p=min (u, v);
q1=1-u;
q2=1-v;
%Display Output
disp(‘Union of Two Fuzzy sets’);
disp(w);
disp(‘Intersection of Two Fuzzy sets’);
disp(p);
disp(‘Complement of First Fuzzy set’);
disp(q1);
disp(‘Complement of Second Fuzzy set’);
disp(q2);
Sample Input and Output: Enter the membership value of First Fuzzy set [0.3 0.4] Enter the membership value of Second Fuzzy set [0.1 0.7] Union of Two Fuzzy sets 0.3000. 0. Intersection of Two fuzzy sets 0.1000 0.4000. Complement of First Fuzzy set 0.7000 0.6000. Complement of Second Fuzzy set 0.9000 0.3000.
Result:
Thus, the MATLAB program to perform Union, Intersection and Complement operations
of two Fuzzy sets has been executed successfully and the output is verified.
disp(w); disp(‘Intersection of two fuzzy sets ’); disp(p); disp(‘Complement of first fuzzy set ’); disp(q1); disp(‘Complement of second fuzzy set ’); disp(q2); disp(‘De-Morgan’s Law’); disp(‘LHS’); disp(x1); disp(‘RHS’); disp(x2); disp(LHS); disp(y1); disp(‘RHS’); disp(y2);
Sample Input and output:
Enter the membership values of first fuzzy set [0.3 0.4] Enter the membership values of second fuzzy set [0.2 0.5] Union of two fuzzy sets 0.3000. 0. Intersection of two fuzzy sets 0.3000 0.4000. Complement of first fuzzy set 0.7000 0.6000. Complement of second fuzzy set
De –Morgan’s Law LHS 0.7000 0. RHS 0.7000 0. LHS 0.8000 0. RHS 0.8000 0.
Result:
Thus, the MATLAB program for implementation of De-Morgan’s has been executed successfully and the output is verified.
y1=gbellmf (x,[3 5 7]);
subplot(313)
plot(x, [y1]);
Sample Input and Output:
Result:
Thus, the MATLAB program for plotting membership functions has been executed successfully and the output is verified.
Ex. No: 4 Date:
Aim : To use fuzzy toolbox to model tips value that is given after a dinner based on quality (not good, satisfying, good and delightful ) and service (poor, average or good) and the tip value ranges from Rs. 10 to 100.
Procedure:
INPUTS:
Quality : { not good, satisfying, good, delightful }
Service : { poor, average, good }
OUTPUT:
Tips : Tip_value ranging from Rs. 10 to 100
Use Fuzzy Inference System (FIS) Editor and perform the following
Membership functions for Quality variable
Membership functions for Service variable
Membership functions for Tips variable
Created rules
Ex. No: 5 Date:
Aim :
To implement a Fuzzy Inference System (FIS) for which the inputs, output and rules are
given as below.
INPUTS: Temperature and Cloud Cover
Temperature: {Freeze, Cool, Warm and Hot} Cloud Cover: {Sunny, Partly Cloud and Overcast}
OUTPUT: Speed
Speed : {Fast and Slow}
RULES:
Procedure
Inputs : Temperature Freezing, Cool, Warm and Hot
MF1: Range : [0 110] Name : Freezing Type : trapmf Parameter [0 0 30 50]
Range : [0 110] Name : Cool Type : trimf Parameter [30 50 70]
Range : [0 110] Name : Warm Type : trimf Parameter [50 70 90]
Range : [0 110] Name : Hot Type : trapmf Parameter [70 90 110 110]
Inputs : Cloud Cover Sunny, Partly Cloud and Overcast MF1: Range : [0 100] Name : Sunny Type : trapmf Parameter [0 0 20 40]
Range : [0 100] Name : Partly Cloud Type : trimf Parameter [20 50 80]
Range : [0 100] Name : Overcast Type : trapmf Parameter [60 80 100]
Output : Speed Slow and Fast MF1: Range : [0 100] Name : Slow Type : trapmf Parameter [0 0 25 75]
Range : [0 100] Name : Fast Type : trapmf Parameter [25 75 100 100]
Membership functions for speed variable
Created rules
Output
Result:
Thus a Fuzzy Inference System is implemented for temperature, cloud cover and speed using the given rules.