This commit is contained in:
iridiumR 2022-05-12 12:15:18 +08:00
parent 094bb164f7
commit b57f2a4c7a

60
Matlab/lab3.m Normal file
View file

@ -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('');