您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > matlab > 隶属函数在MATLAB中应用
620166.16.1.1gaussmfy=gaussmf(x,[sigc])222)cx(e)c,;x(fσ−−=σc,σxsigσ6-1x=0:0.1:10;y=gaussmf(x,[25]);plot(x,y)xlabel('gaussmf,P=[25]')6-1024681000.20.40.60.81gaussmf,P=[25]6-16.1.2gauss2mfy=gauss2mf(x,[sig1c1sig2c2])sig1c1sig2c216-2x=(0:0.1:10)';y1=gauss2mf(x,[2418]);y2=gauss2mf(x,[2517]);y3=gauss2mf(x,[2616]);y4=gauss2mf(x,[2715]);y5=gauss2mf(x,[2814]);MATLAB6.0202plot(x,[y1y2y3y4y5]);set(gcf,'name','gauss2mf','numbertitle','off');6-26.1.3gbellmfy=gbellmf(x,params)b2|acx|11)c,b,a;x(f−+=xbcparamsabc6-3x=0:0.1:10;y=gbellmf(x,[246]);plot(x,y)xlabel('gbellmf,P=[246]')6-3024681000.20.40.60.81024681000.20.40.60.81gbellmf,P=[246]6-26-36.1.4sigmoiddsigmfy=dsigmf(x,[a1c1a2c2])sigmoid)cx(ae11)c,a;x(f−−+=xa,cdsigmfa1c1a2c2sigmoid)c,a;x(f)c,a;x(f222111−]caca[22116-4x=0:0.1:10;y=dsigmf(x,[5257]);plot(x,y)6-46203024681000.20.40.60.816-46.1.5evalmfy=evalmf(x,mfParams,mfType)evalmfxmfTypemfParamsevalmf6-5x=0:0.1:10;mfparams=[246];mftype='gbellmf';y=evalmf(x,mfparams,mftype);plot(x,y)xlabel('gbellmf,P=[246]')6-5024681000.20.40.60.81gbellmf,P=[246]6-56.1.6primfy=pimf(x,[abcd])xx[a,b,c,d]adbc6-6MATLAB6.0204x=0:0.1:10;y=pimf(x,[14510]);plot(x,y)xlabel('pimf,P=[14510]')6-66.1.7sigmoidpsigmfy=psigmf(x,[a1c1a2c2])sigmoid)cx(ae11)c,a;x(f−−+=xa,cpsigmfa1c1a2c2sigmoid)c,a;x(f)c,a;x(f222111∗]caca[22116-7x=0:0.1:10;y=psigmf(x,[23-58]);plot(x,y)xlabel('psigmf,P=[23-58]')6-7024681000.20.40.60.81pimf,P=[14510]024681000.20.40.60.81psigmf,P=[23-58]6-66-76.1.8Sigmoidsigmfy=sigmf(x,[ac]))cx(ae11)c,a;x(f−−+=xac6-8x=0:0.1:10;y=sigmf(x,[24]);plot(x,y)xlabel('sigmf,P=[24]')6-8620501234567891000.10.20.30.40.50.60.70.80.91sigmf,P=[24]6-86-9x=(0:0.2:10)’;y1=sigmf(x,[-15]);y2=sigmf(x,[-35]);y3=sigmf(x,[45]);y4=sigmf(x,[85]);subplot(2,1,1),plot(x,[y1y2y3y4]);y1=sigmf(x,[52]);y2=sigmf(x,[54]);y3=sigmf(x,[56]);y4=sigmf(x,[58]);subplot(2,1,2),plot(x,[y1y2y3y4]);6-9024681000.51024681000.516-96.1.9Ssmfy=smf(x,[ab])%xab6-10x=0:0.1:10;y=smf(x,[18]);plot(x,y)6-10MATLAB6.0206024681000.20.40.60.81smf,P=[18]6-106-11x=0:0.1:10;subplot(3,1,1);plot(x,smf(x,[28]));subplot(3,1,2);plot(x,smf(x,[46]));subplot(3,1,3);plot(x,smf(x,[64]));6-1101234567891000.5101234567891000.5101234567891000.516-116.1.10trapmfy=trapmf(x,[abcd])⎪⎪⎪⎭⎪⎪⎪⎬⎫⎪⎪⎪⎩⎪⎪⎪⎨⎧≤≤≤−−≤≤≤≤−−≤=xd0dxc,cdxdcxb,1bxa,abaxax,0)d,c,b,a;x(ff(x;a,b,c,d)=max(min()0),cdxd,1,abax−−−−xa,b,c,dadbc62076-12x=0:0.1:10;y=trapmf(x,[1578]);plot(x,y)xlabel('trapmf,P=[1578]')6-126-13x=(0:0.1:10)’;y1=trapmf(x,[2379]);y2=trapmf(x,[3468]);y3=trapmf(x,[4557]);y4=trapmf(x,[5646]);plot(x,[y1y2y3y4]);6-1301234567891000.10.20.30.40.50.60.70.80.91trapmf,P=[1578]024681000.20.40.60.816-126-136.1.11trimfy=trimf(x,params)y=trimf(x,[abc])⎪⎪⎪⎭⎪⎪⎪⎬⎫⎪⎪⎪⎩⎪⎪⎪⎨⎧≤≤≤−−≤≤−−≤=xc0cxb,bcxcbxa,abaxax,0),c,b,a;x(ff(x;a,b,c,)=max(min()0),bcxc,abax−−−−xa,b,cacbacb≤≤,trapmf6-14MATLAB6.0208x=0:0.1:10;y=trimf(x,[368]);plot(x,y)xlabel('trimf,P=[368]')6-1401234567891000.10.20.30.40.50.60.70.80.91trimf,P=[368]6-146-15x=(0:0.2:10)’;y1=trimf(x,[345]);y2=trimf(x,[247]);y3=trimf(x,[149]);subplot(2,1,1),plot(x,[y1y2y3]);y1=trimf(x,[235]);y2=trimf(x,[347]);y3=trimf(x,[459]);subplot(2,1,2),plot(x,[y1y2y3]);6-1501234567891000.20.40.60.8101234567891000.20.40.60.816-156.1.12Zzmfy=zmf(x,[ab])%xab6-16x=0:0.1:10;y=zmf(x,[37]);plot(x,y)6209xlabel('zmf,P=[37]')6-166-17x=0:0.1:10;subplot(3,1,1);plot(x,zmf(x,[28]));subplot(3,1,2);plot(x,zmf(x,[46]));subplot(3,1,3);plot(x,zmf(x,[64]));6-17024681000.20.40.60.81zmf,P=[37]024681000.51024681000.51024681000.516-166-176.1.13mf2mfoutParams=mf2mf(inParams,inType,outType)inParamsinTypeoutType:6-18x=0:0.1:5;mfp1=[123];mfp2=mf2mf(mfp1,'gbellmf','trimf');plot(x,gbellmf(x,mfp1),x,trimf(x,mfp2))6-186.1.14FISfuzzyfuzzy%FISfuzzy(fismat)%fuzzy('tipper')FIS01234500.20.40.60.816-18MATLAB6.02106-19FISFileNewmamdaniFIS…mamdaniNewSugenoFIS…SugenoOpenfromdisk….fisSavetodisk.fisSavetodiskas…Openfromworkspace…FISSavetoworkspace…FISSavetoworkspaceas…FISClosewindowsGUIEditAddinputAddoutputRemovevariableUndoViewEditMFs…Editrules…Editanfis…SugenoViewrules…Viewsurface…AndmethodminprodCustomOrmethodmaxproborCustomImplicationmethodminprodCustomSugeno6211AggregationmethodmaxsumproborCustomSugenoDefuzzificationmethodMamdanicentroidbisectormomsomlomCustomSugenowtaverwtsum6.1.15mfeditmfedit('a')mfedit(a)mfeditmfedit('a')a.fisFISmfedit('tank')tank.fismfedit(a)FISMATLABaMfeditFIS6-20ANFISGUIGUIFileFISFileEditAddMF…AddcustomMF…RemovecurrentMFRemoveallMFSUndoViewEditFISproperties…FISMATLAB6.0212Editrules…Viewrules…Viewsurface…6.2FIS6.2.1FISgenfis1fismat=genfis1(data)fismat=genfis1(data,numMFs,inmftype,outmftype)genfis1anfisSugenoFISgenfis1(data,numMFs,inmftype,outmftype)FISDataNumMFsnumMFsInmftypeoutmftype6-19data=[rand(10,1)10*rand(10,1)-5rand(10,1)];numMFs=[37];mfType=str2mat('pimf','trimf');fismat=genfis1(data,numMFs,mfType);[x,mf]=plotmf(fismat,'input',1);subplot(2,1,1),plot(x,mf
本文标题:隶属函数在MATLAB中应用
链接地址:https://www.777doc.com/doc-7028232 .html