ccovdemo1.m
来自「经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助」· M 代码 · 共 28 行
M
28 行
%==========================================================================
% Name:ccovdemo1
% The program demonstrate the convolution operation of two continuou-time signals
% please expressed the signals in terms of the unit step function.
% for example:e(t)=exp(-2*t).*u(t).
%==========================================================================
clear;close all;
t0=-4;%input('请输入信号的起始时间(建议取0—-10):');
t1=4;%input('请输入信号的终止时间(建议取0—10):');
p=.01;
t=t0:p:t1;
x=u(t)-u(t-1);%input('请输入激励信号:');
h=t.*(u(t)-u(t-2));%input('请输入系统冲激响应:');
f=p*conv(x,h);%卷积计算
f1=p*conv(fliplr(x),fliplr(h));
subplot(221)
plot(t,x)
subplot(222)
plot(t,h)
subplot(212)
t = 2*t0:p:2*t1;
plot(t,f)
hold on
plot(t,f1,'r')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?