Professional Documents
Culture Documents
Objective:
The goal of this lab work is to work on fuzzy sets and make operations on them (like
the union of two sets, the complement of a set …) using matlab.
In this sense, fuzzy logic is both old and new because, although the modern and
methodical science of fuzzy logic is still young, the concepts of fuzzy logic relies on
age-old skills of human reasoning
Fuzzy logic is all about the relative importance of precision: How important is it to be
exactly right when a rough answer will do?
1
WHY USE FUZZY LOGIC?
Here is a list of general observations about fuzzy logic:
The mathematical concepts behind fuzzy reasoning are very simple. Fuzzy logic is a
more intuitive approach without the far-reaching complexity.
With any given system, it is easy to layer on more functionality without starting again
from scratch.
Everything is imprecise if you look closely enough, but more than that, most things
are imprecise even on careful inspection. Fuzzy reasoning builds this understanding
into the process rather than tacking it onto the end.
You can create a fuzzy system to match any set of input-output data. This process is
made particularly easy by adaptive techniques like Adaptive Neuro-Fuzzy Inference
Systems (ANFIS), which are available in Fuzzy Logic Toolbox software.
In direct contrast to neural networks, which take training data and generate
opaque, impenetrable models, fuzzy logic lets you rely on the experience of people
who already understand your system.
The basis for fuzzy logic is the basis for human communication. This observation
underpins many of the other statements about fuzzy logic. Because fuzzy logic is built
on the structures of qualitative description used in everyday language, fuzzy logic is
easy to use.
FUZZY SETS
Fuzzy logic starts with the concept of a fuzzy set. A fuzzy set is a set without a crisp,
clearly defined boundary. It can contain elements with only a partial degree of
membership.
In this LABWORK we’ll see how to make operations on fuzzy sets (like the union of two
sets, the complement of a set …) using matlab
2
OPERATIONS ON FUZZY SETS:
the union is calculated by using the maximum degree of membership of the two sets
In Matlab:
EX 1
We consider the following fuzzy sets :
By Expressing the fuzzy sets and using the rules on making operations on fuzzy sets we
solve the problem using the following code in matlab:
% start of code
union
intersection
complementA
complementB
% end of code
3
By executing the code, we get the following results in the command window
EX2
We consider the following fuzzy sets :
Using the rules on making operations on fuzzy sets that we know we solve the
problem using the following code in matlab:
% start of code
% we input the fuzzy set using vectors
for i=2:2:length(A)
intersectionAavecBbarre(i)=min(A(i),1-B(i));
intersectionAavecBbarre(i-1)=min(A(i-1),B(i-1));
intersectionBavecAbarre(i)=min(1-A(i),B(i));
intersectionBavecAbarre(i-1)=min(A(i-1),B(i-1));
end
4
By executing the code, we get the following results in the command window
EX 3
We consider the following fuzzy sets:
Using the rules on making operations on fuzzy sets that we know we solve the
problem using the following code in matlab:
% start of code
% we input the fuzzy set using vectors
intersectionBarre(i)=min(1-A(i),1-B(i));
intersectionBarre(i-1)=min(A(i-1),B(i-1));
unionBarre(i)=max(1-A(i),1-B(i));
unionBarre(i-1)=max(A(i-1),B(i-1));
end
% we display the resulting fuzzy set
intersectionBarre
unionBarre
% end of code
By executing the code, we get the following results in the command window
5
Conclusion:
We can can conclude from this lab work that it is possible to make a lot of
operations on fuzzy sets like unions, intersections, complements or even Demorgan’s
law and that it is very easy to do them in Matlab .