Fuzzy Logic Toolbox , . , , . . :
- anfisedit - FIS , ANFIS
- findcluster - fuzzy c-means
- fuzzy - FIS. FIS - , -. fuzzy GUI-: mfedit, ruleedit, ruleview surfview
- mfedit - . (drag)
- ruleedit -
- ruleview - . , , . (drag)
Simulink
Fuzzy Logic Toolbox , Simulink:
- fuzblock -
- sffis - , Simulink
Fuzzy Logic Toolbox :
- defuzzdm -
- fcmdemo - 2D- fuzzy c-means
- fuzdemos - Fuzzy Logic Toolbox
- gasdemo - ANFIS ( )
- invkine - -
- irisfcm - fuzzy c-means
- juggler -
- noisedm -
- slbb - ( Simulink)
- slcp - ( Simulink)
- sltank - ( Simulink)
- sltankrule - ( Simulink)
- sltbu - ( Simulink)
- mgtsdemo - -
- trips -
- shower -
- slcp1 - " "
- slcpp1 - " "
- slcpp1 - " "
- mfdemo - , Fuzzy Logic Toolbox
- drydemo - ANFIS
|
:
|
|
FIS_name=addmf(FIS_name, varType, varIndex, mfName, mfType, mfParams)
:
MatLab . - newfis. addmf :
- FIS_name MatLab;
- varType , . - input - output ;
- varIndex , ;
- mfName (). ;
- mfType () . ;
- mfParams .
addmf, .. 1. addmf . addvar.
.
FIS_name=addmf(FIS_name, input, 1, , trapmf, [150, 155, 165, 170])
- FIS_name [150, 155, 165, 170].
\ \
|
:
FIS_name= addrule (FIS_name, ruleList)
:
MatLab . addrule :
- FIS_name MatLab;
- ruleList .
indexed. ruleList , .. . m+n+2, m (n) () .
|
|
m , .. - . , . 0 , , .. none.
n , .. - . , .
. [0, 1].
. 1 , 2 .
.
FIS_name=addrule(FIS_name, [1 1 1 1 1; 1 2 2 0.5 1])
FIS_name , :
1=MF1 2=MF1, 1=MF1 1,
1=MF1 2=MF2, 1=MF2 0.5,
MF1 (MF2) 1 (2).
\ \
|
:
FIS_name= addvar (FIS_name, varType, varName, varBound)
:
MatLab . addrvar :
- FIS_name MatLab;
- varType . - input - output ;
- varName . ;
- varBound , .
addvar, .. 1. .
.
FIS_name=addrule(FIS_name, input, , [155 205])
FIS_name , [155 205].
\ \
|
:
[fis, error] = anfis(trndata)
[fis, error] = anfis(trndata, initfis)
[fis, error, stepsize] = anfis(trndata, initfis, trnopt, dispopt, [], optmethod)
[fis, error, stepsize, chkfis, chkerror] = anfis(trndata, initfis, trnopt, dispopt, chkdata)
:
ANFIS Adaptive Network based Fuzzy Inference System. . , , , . . . , , .
anfis - , 1991 (Jang). anfis , . anfis .
anfis :
|
|
- trndata . . , -. , . , anfis SISO ( - ) MISO ( );
- initfis , anfis. . anfis , . initfis anfis genfis1, . . , , initfis . , .
- trnopt :
trnopt(1) ( 10);
trnopt(2) ( 0);
trnopt(3) ( 0.01);
trnopt(4) ( 0.9);
trnopt(5) ( 1.1);
- dispopt , MatLab . 1. dispopt :
dispopt(1) ANFIS-: ..;
dispopt(2) ;
dispopt(3) , ( );
dispopt(4) .
1;
- chkdata . , . . , . . . () . ;
- optmethod , . : 1 0 . , ( ) . , , . , , optmethod 0.
anfis :
|
|
- fis , , ;
- error , . ;
- stepsize , ;
- chkfis , , . anfis ;
- chkerror - , . . anfis .
.
anfis , . anfis . , , , ( - , , ) [] NaN. [] NaN , , . , anfis.m.
.
fis, y=sin(x) [0, 1].
x=(0:0.04:1);
y=sin(x);
trndata=[x y];
[fis, error, stepsize]=anfis(trndata)
\ \
| , Fuzzy Logic Toolbox v.1 Fuzzy Logic Toolbox v.2 |
:
FIS_new= convertis (FIS_old)
:
, FIS_old Fuzzy Logic Toolbox v.1 FIS_new, Fuzzy Logic Toolbox v.2.
\ \
|
:
crisp = defuzz (x, mf, method)
:
, . . . defuzz :
- x , , ;
- mf x , ;
- method . :
centroid ;
bisector ;
mom ;
som - ;
lom - .
1. , m-. x mf .
.
[0, 2, 4, 10]);, {0, 0.1, 0.2,,10}.
x=0:0.1:10;
mf=trapmf(x, [0, 2, 4, 10]);
crisp=defuzz(x, mf, centroid)
\ \
| , |
:
[XI, YI, XO, YO, R] = discfis (fis, numPts)
:
, . discfis :
- fis ;
- numPts , . 181. , 181 . , .
discfis 5 :
|
|
- XI - . numPts x Ninp, Ninp , ;
- YI XI . numPts x Ninp, , ;
- XO - . numPts x Nout, Nout , ;
- YO XO . numPts x Nout, , . YO ;
- R .
:
fis = readfis (tipper);
[XI, YI, XO, YO, R] = discfis (fis)
===================================================================
Tipper.
\ \
|
:
y = dsigmf(x, params)
:
. .
dsigmf :
- x , ;
- params . [a1 c1 a2 c2].
dsigmf y, x.
:
x = 0: 0.1: 10;
y1 = dsigmf (x, [5 1 8 7]);
y2 = dsigmf (x, [5 4 5 7]);
y3 = dsigmf (x, [5 6 2 7]);
plot (x, [y1; y2; y3])
title ('dsigmf: a1=5, c2=7')
ylim([0 1.05])
legend(c1=1, a2=8, c1=4, a2=5, c1=6, a2=2)
===================================================================
[0, 10].
\ \
|
:
output = evalfis(input, fis)
output = evalfis(input, fis, numPts)
[output, IRR, ORR, ARR] = evalfis(input, fis)
[output, IRR, ORR, ARR] = evalfis(input, fis,, numPts)
:
. evalfis , :
- input , . M x N, N ; M . ;
- fis ;
- numPts , . 101. , 101 . , .
evalfis :
- output , input. M x L, M ; L fis;
- IRR NR x N, NR fis; N . , ;
- ORR numPts x (NR*L), numPts ; NR fis; L fis. , . numPts ;
- ARR numPts x L, numPts ; L fis. , . numPts .
IRR, ORR ARR , . IRR, ORR ARR . .
.
- tipper, . , service=3 food=8.
fis = readfis('tipper');
tip = evalfis([3 8], fis)
\ \
|
:
y = evalmf (x, params, type)
:
evalmf :
- x , ;
- params , ;
- type . :
1 - 'trimf';
2 - 'trapmf';
3 - 'gaussmf';
4 gauss2mf';
5 - 'sigmf';
6 - 'dsigmf';
7 - 'psigmf';
8 - 'gbellmf';
9 - 'smf';
10 - 'zmf';
11 - 'pimf'.
, m-.
evalmf y, x.
:
x = 0: 0.1: 10;y = evalmf (x, [0 3 9], 1);plot (x, y)title (Triangular membership function with parameters [0 3 9]')