Monday, November 30, 2015

Decision Making problem by means of fuzzy logic in program language MATLAB








DECISION MAKING PROBLEMS IN MATLAB

The M-file BF.m provides the calculation. See prog.1.

clear all
B1v = readfis('B1.fis');
UdajB1 = input('Input values in the form [I3a; I3b; I3c]: ');
VyhB1 = evalfis(UdajB1, B1v);
B2v = readfis('B2.fis');
UdajB2 = input('Input values in the form [I4a; I4b]: ');
VyhB2 = evalfis(UdajB2, B2v);
BFv = readfis('BF.fis');
UdajBF=input('Input values in the form [I1;I2]: ');
UdajBF(3) = VyhB1;
UdajBF(4) = VyhB2;
VyhBF = evalfis(UdajBF, BFv);
if VyhBF<0.5 'Reject'
elseif VyhBF<0.8 'Monitor'
else 'Accept'
end
fuzzy(BFv)
mfedit(BFv)
ruleedit(BFv)
surfview(BFv)
ruleview(BFv)


The results of calculation are presented by inputs I1,I2, I3a, I3b, I3c, I4a, I4b with values 0, 1 and 0.5. The results are Reject, Accept and Monitor.

Input values in the form [I3a; I3b; I3c]: [0;0;0]
Input values in the form [I4a; I4b]: [0;0]
Input values in the form [I1;I2]: [0;0]
ans =Reject
Input values in the form [I3a; I3b; I3c]: [1;1;1]
Input values in the form [I4a; I4b]: [1;1]
Input values in the form [I1;I2]: [1;1]
ans =Accept
Input values in the form [I3a; I3b; I3c]: [0.5; 0.5; 0.5]
Input values in the form [I4a; I4b]: [0.5; 0.5]
Input values in the form [I1;I2]: [0.5; 0.5]
ans =Monitor

No comments:

Post a Comment