From b57f2a4c7a9e1572e6c116fa90d97a491791efd2 Mon Sep 17 00:00:00 2001 From: iridiumR Date: Thu, 12 May 2022 12:15:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Matlab/lab3.m | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Matlab/lab3.m diff --git a/Matlab/lab3.m b/Matlab/lab3.m new file mode 100644 index 0000000..a3d32dd --- /dev/null +++ b/Matlab/lab3.m @@ -0,0 +1,60 @@ +%% 1 +figure(1); +syms t; +f = cos(2*t)*sin(3*t)*heaviside(t); +L = laplace(f); +subplot(2,1,1); +ezplot(f); +subplot(2,1,2); +display(L); +ezplot(L); + +%% 2 +figure(2); +syms s; +H1 = ((s+1)*(s+4))/(s*(s+2)*(s+3)); +f1 = ilaplace(H1); +H2 = (s^3+5*s^2+9*s+7)/(s^2+3*s+2); +f2 = ilaplace(H2); +subplot(2,1,1); +ezplot(f1); +display(f2); +subplot(2,1,2); +display(f2); +ezplot(f2); + + +%% 3 +figure(3); +a = [1, 0, 1]; +b = [1,2,-3,3,3,2]; +sys = tf(a, b); +pzmap(sys); + + +%% 4 +figure(4); +a = [1, 5]; +b = [1, 5, 6]; +t = 0:0.01:10; +h = impulse(a, b, t); +subplot(3, 1, 1); +plot(t, h); +title('单位冲激响应'); + +syms s t; +H = (s+5)/(s^2+5*s+6); +F = laplace(heaviside(t)); +Y = H*F; +y = ilaplace(Y); +subplot(3, 1, 2); +fplot(y*heaviside(t)); +title('单位阶跃响应'); + +f = exp(-t)*heaviside(t); +Fs = laplace(f); +Ys = H*Fs; +yts = ilaplace(Ys); +subplot(3, 1, 3); +fplot(yts*heaviside(t)); +title('零状态响应'); \ No newline at end of file