**
实验二
**
实验内容
题目一:
clear all;
ts=0;te=5;dt=0.01;
num=[0 3 2];
den=[1 5 6];
sys=tf(num,den);
t=ts:dt:te;
y=impulse(sys,t);
plot(t,y);grid;xlabel('time(sec)');ylabel('h(t)')
题目二:
clear all;
ts=0;te=5;dt=0.01;
num=[0 0 1];
den=[2 1 8];%zuo
sys=tf(num,den);
t=ts:dt:te;
y=impulse(sys,t);
subplot(1,2,1)
plot(t,y);grid;xlabel('time(sec)');ylabel('h(t)')
subplot(1,2,2)
step(num,den);
axis([-5 30 0 0.4])
题目三:
t1=-1:0.01:3;
t2=0:0.01:4;
f1=1.*(t1>1)-1.*(t1>2);
f2=1.*(t2>2)-1.*(t2>3);
c=0.01*conv(f1,f2);
t3=-1:0.01:7;
subplot(3,1,1);plot(t1,f1);grid
subplot(3,1,2);plot(t2,f2);grid
subplot(3,1,3);plot(t3,c);grid
题目四:
4.1:
clear all;
ts=0;te=5;dt=0.01;
a=[0 1 5];
b=[0 3 0];
sys=tf(b,a);
t=ts:dt:te;
y=impulse(sys,t);
plot(y,t)
4.2:
clear all;
ts=0;te=5;dt=0.01;
a=[1 2 1];
b=[0 2 0];
sys=tf(b,a);
t=ts:dt:te;
y=exp(2*t).*(t>0);
lsim(sys,y,t)