📄 response_time.m
字号:
close all,clear;
t=0:0.01:20;
w=-5*pi:0.1:5*pi;
x=exp(-abs(t-10));
num=[1 1];
den=[1 2 2];
[A,B,C,D]=tf2ss(num,den);
h=impulse(num,den,t);
y=lsim(A,B,C,D,x,t);
H=freqs(num,den,w);
phase=angle(H);
subplot(221)
plot(t,h);title('The impulse response h(t)'),grid on;
subplot(223)
plot(t,y);title('The output response y(t)'),grid on;
xlabel('Time sec')
subplot(222)
plot(w,abs(H));title('The magnitude response |H(jw)|'),grid on;
subplot(224)
%plot(w,phase);title('The phase response <H(jw)'),grid on;
%xlabel('Frequency in radians/s')
t=-10:0.01:10;
x=0.4*exp(-t).*cos(t).*u(t)+0.8*exp(-t).*sin(t).*u(t)+0.4*exp(t).*u(-t);
plot(t,x)
grid on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -