Ä£ºý¿ØÖÆÆ÷Éè¼Æ

y3 = gaussmf(x, [10 0]); y4 = gaussmf(x, [10 33]); y5 = gaussmf(x, [10 66]); y6 = gaussmf(x, [10 100]); a=[y0 y1 y2 y3 y4 y5 y6]; b=max(a);

% caculate input in fuzzy zone,get input_type and input_authorityvalue if x<=100 & x>=-100 if b==a(1) type='NB'; authorityvalue=y0; elseif b==a(2) type='NM'; authorityvalue=y1; elseif b==a(3) type='NS'; authorityvalue=y2; elseif b==a(4) type='ZE'; authorityvalue=y3; elseif b==a(5) type='PS'; authorityvalue=y4; elseif b==a(6) type='PM'; authorityvalue=y5; else b==a(7) type='PB';

17 / 27

authorityvalue=y6; end else

if x>100 type='PB'; authorityvalue=1; elseif x<-100 type='NB'; authorityvalue=1; end end type

authorityvalue % caculate output by if type=='NB'

out=authorityvalue*0;

% if input is NB, then output is PB; elseif type=='NM' out=authorityvalue*17;

% if input is NM, then output is PM; elseif type=='NS' out=authorityvalue*34;

% if input is NS, then output is PS; elseif type=='ZE' out=authorityvalue*51;

% if input is ZE, then output is ZE; elseif type=='PS' out=authorityvalue*68;

% if input is PS, then output is NS;

18 / 27

elseif type=='PM' out=authorityvalue*85;

% if input is PM, then output is NM; else type=='PB'

out=authorityvalue*100;

% if input is PB, then output is NB; end out ½á¹ûΪ£º X=14 type =ZE

authorityvalue = 0.3753 out = 19.1409 X=-150 type =NB

authorityvalue =1 out =0

2. Éè¼ÆÒ»¸öÄ£ºý¿ØÖÆÆ÷£¬Âú×ãÈçÏÂÌõ¼þ£º

ÊäÈ룺-10-10·¶Î§ÄÚ·ÖΪ3¸öÂÛÓò£¬NB ZE PB£»Á¥Êô¶Èº¯ÊýÂú×ã¸ß˹·Ö²¼£» ÊäÈëµÄÎó²î£º-2-2·¶Î§ÄÚ·ÖΪ3¸öÂÛÓò£¬NB ZE PB£»Á¥Êô¶Èº¯ÊýÂú×ã¸ß˹·Ö²¼£»

Êä³ö£º0µ½100·¶Î§ÄÚ·ÖΪ5¸öÂÛÓò£¬NB NM ZE PM PB£¬Á¥Êô¶Èº¯ÊýΪ³£Êý1¡£

Ä£ºýÍÆÀí¹ý³Ì£¬output=(ÊäÈëÁ¥Êô¶Èº¯ÊýÖµ+ÊäÈëÎó²îµÄÁ¥Êô¶Èº¯ÊýÖµ)/2*Êä³öÂÛÓòµÄÖÐÐÄÖµ¡£ ¿ØÖƹæÔò£º

% % if input is NB and errorinput is NB, then output is NB; % % if input is NB and errorinput is ZE, then output is NM;

19 / 27

% % if input is NB and errorinput is PB, then output is ZE; % % if input is ZE and errorinput is NB, then output is NM; % % if input is ZE and errorinput is ZE, then output is ZE; % % if input is ZE and errorinput is PB, then output is PM; % % if input is PB and errorinput is NB, then output is ZE; % % if input is PB and errorinput is ZE, then output is PM; % % if input is PB and errorinput is PB, then output is PB; 1.ÊäÈëΪ£º ³ÌÐòΪ£º x1 = (-10:0.1:10)'; y0 = gaussmf(x1, [3 -10]); y1 = gaussmf(x1, [3 0]); y2 = gaussmf(x1, [3 10]); plot(x1,[y0 y1 y2]);

2.Îó²îͼ£º ³ÌÐòΪ£º

x1 = (-2:0.1:2)';

20 / 27

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ìæ»»Îª@)