?? corr_conv.m
字號:
%Compare the calculations of convolution and correlation of two arrays..
x = [1 2 4 -2 3 -6];
y = [-1 2 4 -3 5];
xy_corr = xcorr(x,y);
y = -y;
y = fliplr(y);
xy_conv = conv(x,y);
lth = max(length(xy_corr),length(xy_conv));
if 1,
% stem(1:lth+1,xy_corr,1:lth+1,xy_conv);
legend('Correlation','Convolution')
title('Comparation')
% % stem(1:lth,xy_corr)
stem(1:lth,xy_corr,'bo--')
hold on
stem(1:lth-1,xy_conv,'rx')
% hold on
% stem(xy_conv,'kx')
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -