func
tion [ ] = week9( )
% 函数名:week9
% 功能:完成第9周小课实验
% 日期:2017年4月30日
% 作者:随意转载
subplot(4,2,1);
t = -1 : 0.001 : 1;
plot(t,t>0)
axis([-1,1,-0.1,1.1]);
title('图<1>');
% % % % % % % % % % % %
subplot(4,2,2);
t = -1 : 0.001 : 1;
plot(t~=t,t==0);
axis([-0.5,0.5,-0.1,1.1]);
title('图<2>');
% % % % % % % % % % % %
subplot(3,2,3)
t = 0 : 0.0001 : 6.001;
plot(t,((0<t-2)+...
(2)+...
(2<=t & t<=4))+...
(-(4 < t))+...
(t>(6.001-0.001)).*(-2))
axis([-0.5,7,-0.5,4.5]);
title('图<3>');
% % % % % % % % % % % %
subplot(3,2,4)
t=-3:0.0001:3.01;
f=tripuls(t,2,0);
plot(t+3,f.*2+(t>(3.01-0.01)).*(-2)+2);
axis([-0.5 6.5 -0.5 4.5])
title('图<4>');
% % % % % % % % % % % %
subplot(3,2,5)
t=-3:0.0001:3;
f=tripuls(t,6,0);
y = f.*(3*4/2);
y(t>-1&t<1) = y(t==-1);
plot(t+3,y);
axis([-0.5 6.5 -0.5 5])
title('图<5>');
% % % % % % % % % % % % %
subplot(3,2,6)
syms t;
ft = sym('sin(pi*t)+2*cos(2*t)');
ezplot(t,ft);xlabel('');ylabel('');
title('图<6>');
end
一周热门 更多>