信号与系统 MATLAB
1.求解零状态响应
系统方程:y''(t)+4y'(t)+2y(t)=f'(t)+3f(t);激励信号:f(t)=exp(-t)u(t);求零状态响应。
t=0:0.01:10;
sys=tf([0 1 3],[1 4 4]);
f=exp(-t).*heaviside(t);
y=lsim(sys,f,t);plot(t,y);grid on;
title('第二问');xlabel('t');ylabel('y(t)');
2.求系统的冲击信号与阶跃信号
系统1方程:y''(t)+3y'(t)+2y(t);系统2方程:y''(t)+2y'(t)+2y(t)=f'(t)。
t=0:0.01:10;
sys1=tf([0 0 1],[1 3 2]);
h1=impulse(sys1,t);
subplot(221);plot(t,h1);
grid on
title('冲击响应1');xlabel('t');ylabel('h1(t)');
g1=step(sys