필터 지우기
필터 지우기

unable to calculate autocorrelation with a for loop by using xcorr

조회 수: 3 (최근 30일)
toka55
toka55 2017년 11월 14일
답변: toka55 2017년 11월 14일
I try to calculate the autocorrelation of a signal by using xcorr in this loop:
autc = nan(size(dec.cd{1, 1}));
for k=1:size(dec.cd{1, 1},2)
[rmm, lags] =xcorr(dec.cd{1, 1}(:,k));
rmm = rmm(lags>0);
autc(:,k) = rmm;
end;
I get the error: Subscripted assignment dimension mismatch.
Any idea were the mismatch is?

채택된 답변

Honglei Chen
Honglei Chen 2017년 11월 14일
Looks like it should be
rmm = rmm(lags>=0)
HTH

추가 답변 (1개)

toka55
toka55 2017년 11월 14일
That's it. Thanks

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by