ex_3.m

来自「信号与系统分析以matlab实现」· M 代码 · 共 33 行

M
33
字号
%p138 ex4
%(1)
clear all;
p=0.01;                           
k1=0:p:5;                       
f1=k1;  
k2=0:p:6;                  
f2=ones(1,length(k2));
f=conv(f1,f2);                   
f=f*p;                                 
k3=length(f1)+length(f2)-2;
k0=k1(1)+k2(1);                 
k=k0:p:(k3*p+k0)
figure(1)
subplot(3,1,1),plot(k1,f1),axis([-1.1,1.1,0,4]),grid on
subplot(3,1,2),plot(k2,f2),axis([-2.2,2.2,0,2]),grid on
subplot(3,1,3),plot(k,f),grid on
%(3)
clear all;
p=0.01;                           
k1=0:p:5;                       
f1=exp(-2*k1);  
k2=0:p:6;                  
f2=exp(-k2);
f=conv(f1,f2);                   
f=f*p;                                 
k3=length(f1)+length(f2)-2;
k0=k1(1)+k2(1);                 
k=k0:p:(k3*p+k0) 
figure(2)
subplot(3,1,1),plot(k1,f1),axis([-1.1,1.1,0,4]),grid on
subplot(3,1,2),plot(k2,f2),axis([-2.2,2.2,0,2]),grid on
subplot(3,1,3),plot(k,f),grid on

⌨️ 快捷键说明

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