croscor.m

来自「王小平《遗传算法——理论、应用与软件实现》随书光盘」· M 代码 · 共 19 行

M
19
字号
function out=croscor(in1,in2,maxshft);
%
% Computes cross correlation vector
% by shifting in2 in 1 timestep
% steps up to a maximum timeshift
% of "maxshft"
%
% Call:	out=croscor(in1,in2,maxshft);
%

out=[];
for i = 0:maxshft
	temp=[];
	temp=timeshft([in1 in2],[0 i]);
	c=corrcoef(temp(:,1),temp(:,2));
	out(i+1,1)=c(2,1);
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?