This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/Matlab/sig_sys/lab1.m

52 lines
697 B
Mathematica
Raw Normal View History

2022-04-26 06:51:03 +00:00
figure(1);
syms x;
t=-5:0.0001:5;
fx=heaviside(x+2)-heaviside(x-2);
ezplot(fx,[-5,5]);
figure(2);
fy=heaviside(x+0.2)-heaviside(x-0.2);
ezplot(fy,[-5,5]);
figure(3);
fz=heaviside(x+0.1)-heaviside(x-0.1);
ezplot(fz,[-5,5]);
figure(4);
fa=5*cos(12*pi*t)+6*cos(18*pi*t);
plot(t,fa);
figure(5);
fb=(cos(2*pi*t)).*(cos(2*pi*t));
plot(t,fb);
figure(6);
t = 0:0.1:10;
b1=[1,5,6];
a1=[1,5];
sys=tf(a1,b1);
y1=step(sys,t);
a2=[1,5];
b2=[1,2,5];
sys=tf(a2,b2);
y2=step(sys,t);
a3=[1.5];
b3=[1,2,1];
sys=tf(a3,b3);
y3=step(sys,t);
plot(t,y1,t,y2,'--',t,y3,'+');
figure(7);
sys=tf([1,2],[1,3,2]);
y=impulse(sys,t);
plot(t,y);
2022-05-11 13:19:35 +00:00
figure(8);
2022-04-26 06:51:03 +00:00
f=cos(t);
sys=tf([-1,2],[1,3,2]);
y=lsim(sys,f,t);
plot(t,f);