1.传递函数模型:>>num=[1];>>den=[12.51];>>model=tf(num,den)Transferfunction:1---------------s^2+2.5s+1零极点增益模型:num=[1];den=[12.51];[z,p,k]=tf2zp(num,den);sys=zpk(z,p,k)>>Zero/pole/gain:1-------------(s+2)(s+0.5)2.闭环传递函数num1=[10];den1=[510];num2=[0.81];den2=[1];sys1=tf(num1,den1);sys2=tf(num2,den2);sys=feedback(sys1,sys2,-1)>>Transferfunction:s-------------5.8s^2+2s实验二1num=[1.4];den=[24.510];rlocus(num,den);根轨迹图单位阶跃响应曲线:t=0:0.01:2;num=[1.4];den=[24.510];[y,x,t]=step(num,den,t);plot(t,y);g0=tf(1.4,[2,4.5,1]);[y,t]=step(g0);[mp,ind]=max(y);dimt=length(t);yss=y(dimt);pos=100*(mp-yss)/ysstp=t(ind)fori=1:dimtify(i)>=1tr=t(i);break;endend;fori=1:length(y)ify(i)<=0.98*yss|y(i)>=1.02*yssts1=t(i);endend;fori=1:length(y)ify(i)<=0.95*yss|y(i)>=1.05*yssts2=t(i);endend;tr,ts1,ts2pos=0tp=24.9570tr=5.7423ts1=15.6809ts2=12.1472t=0:0.01:2;num=[1.4];den=[24.51];[y,x,t]=step(num,den,t);plot(t,y);%求超调量[maxy,tf]=max(y);yss=y(length(t));cs=length(t);pos=100*(maxy-yss)/yss;%求峰值时间tp=t(tf);%求调节时间i=cs+1;n=0;whilen==0,i=i-1;ifi==1,n=1;elseify(i)>1.05*yssn=1;endend;t1=t(i);cs=length(t);j=cs+1;n=0;whilen==0,j=j-1;ifj==1,n=1;elseify(j)<0.95*yssn=1;endend;t2=t(j);ift2t2ts=t1;endelseift2>tpift2=1tr=t(i);break;endend;fori=1:length(y)ify(i)<=0.98*yss|y(i)>=1.02*yssts1=t(i);endend;fori=1:length(y)ify(i)<=0.95*yss|y(i)>=1.05*yssts2=t(i);endend;tr,ts1,ts2pos=78.2891tp=0.5063tr=0.2848ts1=7.5940ts2=5.6006>>