example3_2.m

来自「经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助」· M 代码 · 共 49 行

M
49
字号
% Example3_2
close all
t=-2:0.01:2;
x0=(t+eps)./(t+eps);
x1=cos(2*pi*t)/2;
x2=cos(4*pi*t);
x3=2*cos(6*pi*t)/3;

subplot(411)
plot(t,x0)
axis([-2,2,-1.5,3])
text(-1,2,'x0(t)=1')

subplot(423)
plot(t,x1)
axis([-2,2,-1.5,3])
text(-1,2,'x1(t)=cos(2*pi*t)/2')

subplot(425)
plot(t,x2)
axis([-2,2,-1.5,3])
text(-1,2,'x2(t)=cos(4*pi*t)')

subplot(427)
plot(t,x3)
axis([-2,2,-1.5,3])
text(-1,2,'x2(t)=2cos(6*pi*t)/3')

subplot(424)
plot(t,x0+x1)
axis([-2,2,-0.5,4])
text(-1,3,'x0+x1')

subplot(426)
plot(t,x0+x1+x2)
axis([-2,2,-0.5,4])
text(-1,3.5,'x0+x1+x2')

subplot(428)
plot(t,x0+x1+x2+x3)
axis([-2,2,-0.5,4])
text(-1,3.5,'x0+x1+x2+x3')

figure(2)
subplot(221)
plot(t,x0+x1+x2+x3)
axis([-2,2,-0.5,4])
title('x0+x1+x2+x3')
xlabel('Time t')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?