tsfuzzyp28.m
来自「Fuzzy Control Systems Design and Analysi」· M 代码 · 共 65 行
M
65 行
clear;clc;a=1;x(1:2,1)=[0.9 -0.7]';for t=1:1:30A1=[1 -0.5 1 0];A2=[-1 -0.5 1 0];% MBF% M1 M2 %---------- \ / ---------- % \ / % \ / % \ % / \ %------------------------------------% -a a%M1if x(2,t)<=-a; M1=1;endif x(2,t) > -a;M1=(a-x(2,t))/(a-(-a));endif x(2,t) > 1 ; M1=0;end%M2if x(2,t)<=-a;M2=0;endif x(2,t) > -a;M2=(x(2,t)+a)/(a-(-a));endif x(2,t) >= 1 ;M2=1;end%Dfuzzyx(1:2,t+1)=(M1*A1*x(1:2,t)+M2*A2*x(1:2,t))/(M1+M2);endc=1:1:31;fi1=figure;set(fi1,'color','white');set(fi1,'name',datestr(now,30));plot(c,x(1,:),'r','LineWidth',2.5)axis([1 20 -6 6])xlabel('t'); ylabel('x1(t)');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?