📄 corre.m
字号:
function [r,lag]=corre(x,string,id,y)
% x:the reference sequence
% y:the second sequence
% Compute the correlation sequence
if nargin<3
error('Not enough input varibles')
end
if nargin==3
y=x;
n1=length(y)-1;
n2=n1;
else
n1=length(y)-1;
n2=length(x)-1;
end
r = conv(x,fliplr(y));
lag= (-n1):n2;
%画图
figure(ceil(id/4)+2)
id=rem(id,4);
if id==0
id=4;
end
subplot(220+id)
stem(lag,r);
xlabel('Lag index'); ylabel('Amplitude');
title(string)
v = axis;
axis([-n1 n2 v(3:end)]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -