===================================================================
[0 3 9] [0, 10].
\ \
|
:
y = evalmmf (x, params, types)
:
, . evalmmf :
- x , ;
- params . , ..;
- types . , .. : 1 - 'trimf'; 2 - 'trapmf'; 3 - 'gaussmf'; 4 gauss2mf'; 5 - 'sigmf'; 6 - 'dsigmf'; 7 - 'psigmf'; 8 - 'gbellmf'; 9 - 'smf'; 10 - 'zmf'; 11 - 'pimf'. , m-.
evalmmf y, x. , ..
:
x = 0:0.2:10;para = [-1 2 3 4; 3 4 5 7; 5 7 8 0; 2 9 0 0];type = str2mat('pimf', 'trapmf', 'trimf', 'sigmf');mf = evalmmf(x, para, type);
plot(x', mf');
ylim([0 1.05])
legend('pimf', 'trapmf', 'trimf', 'sigmf');
===================================================================
-, , [0, 10].
\ \
| c-means |
:
[V, M, obj_fcn] = fcm(X, c)
[V, M, obj_fcn] = fcm(X, c, options)
:
c-means . (James Bezdek) 1981 .
.
:
- , (n ). p- ();
- c ().
X .
, , , , . , ( p- ) , :
|
|
;
;
.
, , . . , , .
() .
- , . . , - . c- ( ) :
- , , ;
- , ;
- , .
, c- , . (2) (3) , 1, , , , .
, . . p- , , , .
, :
,
- i- , ; - ().
. . , c- , , , . . . , . . .
, . fcm.
fcm :
- X , , . ();
- c , fcm. 1 , X;
- options , :
options(1) ( 2.0);
options(2) ( 100);
options(3) ( 0.00001);
options(4) fcm ( 1).
NaN options.
.
|
|
fcm :
- V , . ;
- M . .
- obj_fcn .
: c-means Zimmermann H.-J. Fuzzy Set Theory - and Its Applications.3rd ed.- Kluwer Academic Publishers, 1996.- 435p.
.
, . . +. o . . , .
X=[1 1; 1 4; 1 7; 3 2; 3 4; 3 6; 5 4; 7 4; 9 4; 11 2; 11 4; 11 6; 13 1; 13 4; 13 7];
[V M opt]=fcm(X, 2)
subplot(2,1,1);
plot(X(:,1), X(:,2), 'ko', 'markersize', 6)
text=' ';
title(text)
xlim([0 14])
ylim([0 8])
subplot(2,1,2);
plot(V(1,1), V(1,2), 'r+', 'markersize', 10)
hold on
plot(V(2,1), V(2,2), 'b+', 'markersize', 10)
for i=1:15
plot(X(i,1), X(i,2)+.05, 'ro', 'markersize', M(1,i)*8+2);
plot(X(i,1), X(i,2)-.05, 'bo', 'markersize', M(2,i)*8+2);
end
xlim([0 14])
ylim([0 8])
text=' ';
title(text)
\ \
| , |
:
rownum = findrow (str, strmat)
:
findrow strmat, , str. , findrow . findrow , , Fuzzy Logic Toolbox.
:
rownum = findrow(' ', [''; ' '; ' '])
===================================================================
2, , ' ' [''; ' '; ' '].
\ \
|
:
aout = fstrvcat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11)
:
fstrvcat aout, a1, a2, a3, . , , . 11. fstrvcat , . aout .
fstrvcat , , fis-.
:
aout = fstrvcat ('hi', 'blue', [110 101 101 100 108 101])
===================================================================
fstrvcat :
aout =
104 105 0 0 0 0
98 108 117 101 0 0
110 101 101 100 108 101,
ASCII.
\ \
|
:
c = fuzarith(x, a, b, operator)
:
, , .
|
|
fuzarith :
- x , ;
- a , . . , x a ;
- b , . , .. x b ;
- operator :
sum ;
sub ;
prod ;
div .
fuzarith x . x, a, b c .
fuzarith :
- - - ;
- - ;
- - .
fuzarith . - 101.
, , , .
, , . fuzarith , .. x. fuzarith - . - fuzarith intervalC.
:
c a b , {0, 0.01, , 1}. .
x=0:0.01:1;
a=gaussmf(x, [0.1 0.3]);
b=gaussmf(x, [0.2 0.6]);
c=fuzarith(x, a, b, 'prod');
plot(x, a, x, b, x, c)
legend('a', 'b', 'c=a*b')
\ \
|
:
y = gauss2mf (x, params)
:
:
c1<c2, ;
c1>c2, .
c1<c2, :
1 (2) () ;
a1 (a2) () .
c1>c2, .
gauss2mf . gauss2mf :
- x , ;
- params . [a1 c1 a2 c2].
gauss2mf y, x.
:
x = 0: 0.1: 10;
y1 = gauss2mf (x, [2 1 1 3]);
y2 = gauss2mf (x, [2 4 1 5]);
y3 = gauss2mf (x, [2 6 1 6]);
plot (x, [y1; y2; y3])
title ('gauss2mf, a1=2, a2=1')
ylim([0 1.05])
legend(c1=1, c2=3, c1=4, c2=5, c1=6, c2=6)
|
|
===================================================================
[0, 10].
\ \
|
:
y = gaussmf (x, params)
:
gaussmf . , :
b ;
c .
gaussmf . gaussmf :
- x , ;
- params . [c b].
gaussmf y, x.
:
x = 0: 0.1: 10;
y1 = gaussmf(x, [0.5 5]);
y2 = gaussmf(x, [1 5]);
y3 = gaussmf(x, [2 5]);
y4 = gaussmf(x, [3 5]);
plot (x, [y1; y2; y3; y4])
title (' gaussmf, b=5, c=0.53')
legend(c=0.5, c=1, c=2, c=3)
===================================================================
.
\ \
|
:
y = gbellmf (x, params)
:
gbellmf . , :
a - ;
b ;
c .
gbellmf . gbellmf :
- x , ;
- params . [a b c].
gbellmf y, x.
:
x = 0: 0.1: 10;
y1 = gbellmf (x, [3 1 5]);
y2 = gbellmf (x, [3 2 5]);
y3 = gbellmf (x, [3 3 5]);
plot (x, [y1; y2; y3])
title (' gbellmf, a=3, b=1,,3, c=5')
legend(b=1, b=2, b=3)
===================================================================
.
\ \
|
:
fis = genfis1(data, numMFs, inmftype, outmftype)
:
genfis1 . , . - , , genfis1 . , , . , . . ANFIS, , , .
genfis1 :
- data , ;
- numMFs , . , . 2;
- inmftype , . , . . ;
- outmftype , ( , ). : linear 'constant' . .
genfis1 fis, .
|
|
:
data = [rand(10,1) 10*rand(10,1)-5 rand(10,1)];
fis = genfis1(data,[3 7],char('pimf','trimf'))
===================================================================
data. - .
\ \
|
:
fis = genfis2(Xin, Xout, radii, xBounds, options)
:
genfis2 . , genfis2 ANFIS.
genfis2 . subclust - . "-" . , .
genfis2 , :