Professional Documents
Culture Documents
TP1
TP1
"8 E
+
*'466
,
<7> ,F?$
6E
service = 0:.5:10;
tip = 0.15*ones(size(service));
plot(service,tip);
xlabel('Service'); ylabel('Tip');
ylim([0.05 0.25])
>
Fuzzy vs. Nonfuzzy Logic
tip = (.20/10)*service+0.05;
plot(service,tip);
xlabel('Service'); ylabel('Tip');
ylim([0.05 0.25])
1 Getting Started
food = 0:.5:10;
[F,S]=meshgrid(food,service);
tip = (0.20/20).*(S+F)+0.05;
)
Fuzzy vs. Nonfuzzy Logic
surf(S,F,tip);
xlabel('Service'); ylabel('Food');zlabel('Tip');
servRatio = 0.8;
tip = servRatio*(0.20/10*S+0.05) + ...
(1-servRatio)*(0.20/10*F+0.05);
surf(S,F,tip);
xlabel('Service'); ylabel('Food'); zlabel('Tip');
6
1 Getting Started
7
Fuzzy vs. Nonfuzzy Logic
xlabel('Service'); ylabel('Tip');
ylim([0.05 0.25]);
servRatio=0.8;
tip = zeros(size(S));
tip(S<3) = ((0.10/3)*S(S<3)+0.05)*servRatio + ...
(1-servRatio)*(0.20/10*F(S<3)+0.05);
tip(S>=3 & S<7) = (0.15)*servRatio + ...
(1-servRatio)*(0.20/10*F(S>=3 & S<7)+0.05);
tip(S>=7 & S<=10) = ((0.10/3)*(S(S>=7 & S<=10)-7)+0.15)*servRatio + ...
(1-servRatio)*(0.20/10*F(S>=7 & S<=10)+0.05);
surf(S,F,tip);
8
1 Getting Started
xlabel('Service'); ylabel('Food');zlabel('Tip');
#8
$678
&%
77
$
7
7
7&
!$ 8 #
8
8&
9
Fuzzy vs. Nonfuzzy Logic
G %7$
G %78
$8
G %7F$8
*=
Problem Solution
gensurf(readfis('tipper'));
:
1 Getting Started
#&
0
66F7&27
6&% #
$6 6
$
$ &0$
7DD86
&($ 6
677
7
8
6
&!#86<
7 &
;
Fuzzy vs. Nonfuzzy Logic
=
26
<#678
7DD
78 87DD8&
<
1 Getting Started
)>