impulse(b,a,t); title('脉冲响应'); subplot(2,1,2); step(b,a,t); title('阶跃响应'); w=0:0.1:2*pi*5; figure(2); freqs(b,a,w); title('频率响应');
3.求出系统在0-30秒范围内,并以时间间隔0.01秒取样的冲激响应和阶跃响应的数值解,以及频率响应数值解,并用数值解画出波形 a=[2,1,8]; b=[1]; t=0:0.01:30; y1=impulse(b,a,t); figure(1); subplot(2,1,1); plot(t,y1); title('脉冲响应'); y2=step(b,a,t); subplot(2,1,2); plot(t,y2); title('阶跃响应'); w=0:0.1:2*pi*5; H=freqs(b,a,w); mag=abs(H);
phase=angle(H)*180/pi; figure(2); subplot(2,1,1); plot(w,mag); grid on;
xlabel('Frequency(rad/s)'),ylabel('Magnitud频曲线'); subplot(2,1,2); plot(w,phase); grid on;
xlabel('Frequency(rad/s)'),ylabel('Phase(deg)频曲线');