第二单元
M2-1
(1)
>> t=-5:0.01:5; x=(t>0)-(t>2); plot(t,x);
axis([-5,5,-2,2]);
21.510.50-0.5-1-1.5-2-5-4-3-2-1012345
(2)
t=-5:0.01:5; >> x=(t>0); >> plot(t,x);
>> axis([-5,5,-2,2]);
21.510.50-0.5-1-1.5-2-5-4-3-2-1012345
(3)
t=-1:0.01:10;
>> x=10*exp(-t)-5*exp(-2*t); >> plot(t,x);
50-5-10-20246810
(4)
t=-1:0.01:10; >> x=t.*(t>0); >> plot(t,x);
109876543210-20246810
(5)
t=-10:0.001:10;
>> pi=3.14;x=2*abs(sin(10*pi*t+pi/3)); >> plot(t,x);
21.81.61.41.210.80.60.40.20-10-8-6-4-20246810
(6)
t=-10:0.001:10;
>> x=cos(t)+sin(2*pi*t); >> plot(t,x);
21.510.50-0.5-1-1.5-2-10-8-6-4-20246810
(7)
>> t=-10:0.001:10; pi=3.14;
>> x=4.*exp(-0.5.*t).*cos(2.*pi*t); plot(t,x);
6004002000-200-400-600-10-8-6-4-20246810
(8)
t=-10:0.001:10; >> pi=3.14;
x=sin(pi*t)./(pi*t).*cos(30*t); >> plot(t,x);