Can anyone provide a code for calculating autocorrelation without autocorr?

30 ビュー (過去 30 日間)
Anuradha Bhattacharya
Anuradha Bhattacharya 2015 年 10 月 26 日
コメント済み: ASWIN SEKHAR C S 2023 年 8 月 16 日
Can anyone provide a code for calculating autocorrelation without using autocorr as I do not have the econometrics toolbox?

回答 (3 件)

Walter Roberson
Walter Roberson 2015 年 10 月 26 日

Abdul Wasay
Abdul Wasay 2020 年 2 月 16 日
x=input('Enter the first Sequence : ');
h=input('Enter the second sequence : ');
n=length(x);
m=length(h);
k=n+m-1;
x=[x zeros(1,k-n)]';
h=wrev(h);
h=[h zeros(1,k-m)]';
for i=1:k
c(:,i)=circshift(x,i-1);
end
y=c*h;
disp('Correlation of the sequences')
disp(y');

i Wijayanto
i Wijayanto 2020 年 9 月 29 日

カテゴリ

Help Center および File ExchangeElementary Math についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by