?? ccovdemo1.m
字號:
%==========================================================================
% 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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -