xcorr different results on different computers with NaN datasets

조회 수: 1 (최근 30일)
Daniel Morgan
Daniel Morgan 2020년 6월 3일
댓글: Daniel Morgan 2020년 6월 3일
I'm currently running a fairly complicated piece of code that is comparing around 70 datasets with each other and returning a correlation matrix that determines how closely correlated each dataset is with the others using the following syntax:
[c,lags] = xcorr(seq1,seq2,maxlag,'coeff');
xcorr is a function from the Signal Processing Toolbox
Several of these datasets do not actually contain data, and have been entered as NaN arrays. The problem comes when I run this code on different computers. On one computer, both the 'c' and 'lag' are returned as NaN arrays. On another computer, they are returned as empty variables. As it is fairly crucial that this code run in exactly the same way on any given computer, it's really important I find out why and how this is happening. Does anyone have any concrete explanations?

답변 (1개)

the cyclist
the cyclist 2020년 6월 3일
편집: the cyclist 2020년 6월 3일
Are the computers running the same version of MATLAB?
Also, there is an xcorr function in base MATLAB. Is it possible that one of the computers does not have the Signal Processing Toolbox installed? (This seems unlikely to be the solution, since it has a different calling syntax.)
What does
which xcorr
give on both computers?
  댓글 수: 1
Daniel Morgan
Daniel Morgan 2020년 6월 3일
You got it! It's not my code, and apparently somebody had written a wholely new xcorr function. One computer was using the new code while the other one was using the official MATLAB version.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by