Filter löschen
Filter löschen

xcorr different results on different computers with NaN datasets

1 Ansicht (letzte 30 Tage)
Daniel Morgan
Daniel Morgan am 3 Jun. 2020
Kommentiert: Daniel Morgan am 3 Jun. 2020
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?

Antworten (1)

the cyclist
the cyclist am 3 Jun. 2020
Bearbeitet: the cyclist am 3 Jun. 2020
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 Kommentar
Daniel Morgan
Daniel Morgan am 3 Jun. 2020
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.

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by