?? 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 + -