📄 correlation.m
字号:
function corr = correlation(a,b)
% CORRELATION Calculate the correlation of binary sequences
%
% Corr = CORRELATION(A,B) computes the correlation of binary sequences
% A and B. The results is stored in a row vector Corr. Each element in
% Corr is the correlation of A and a right-shift version of B
%
% If A = B, Cor is the autocorrelation of A.
%
for i = 0:length(a)-1
corr(i+1) = sum(a.*circshift(b,[0 i]));
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -