Why does Matlab's xcorr function give a different solution than Excel's correl function for some data sets?
이전 댓글 표시
For this simple two column data set, with 89 rows, I observed a different solution for the zero lag correlation coefficient in microsoft excel than I found for the zero lag solution value in Matlab using xcorr. The Excel value is 0.709183, whereas the Matlab value is only 0.5889
I used this code in matlab to develop the lag correlation set: [cross,lags] = xcorr(column1,column2,45,'coeff'); stem(lags,cross) The zero lag value for the matlab solution is at lag 46 I believe.
Which solution is correct and why?
답변 (1개)
Stephan
2016년 10월 20일
0 개 추천
you need to use the matlab function corrcoef() to get the same result. I tried and they are the same. Good luck.
카테고리
도움말 센터 및 File Exchange에서 Correlation and Convolution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!