Cross-correlation in Matlab

Hi,i have foure equation
,and i want to find cross-correlation between two different initial value for the same variable for example x0=1.528121243912454,x0=1.528121243912453 ,apply the function in matlab xcorr but the result i get it is wrong because i observe beak in zero
,how apply thats function and get result without peak?????? file in matlab down

6 Comments

What would you expect to find? If you cross-correlate two signals that are very similar, as with such a tiny change in x or y, then you would expect a lag of 0 to give the highest correlation, by some distance.
Thank you for your answer but in some paper use the same initial for example to y or to x get not peak in cross-correlation as below
2.PNG
>>i want to know if my answer true or false
dpb
dpb on 23 Apr 2019
Edited: dpb on 23 Apr 2019
Apparently your solution didn't match that of the referenced paper...can you somehow verify your code reproduces the same identical sequences as those of the authors thereof?
In such calculations, even the tiniest difference in how source code is converted to calculation can change rounding and the result evolve totally differently with iteration owing to such...or, your code may actually have rounding such that the two sequences actually are identical; I didn't check.
Did the authors publish their source code or otherwise document their solution technique to be able to reproduce it? That's where I'd start...I wouldn't suspect the xcorr function to be lying; I'd think the two sequences generated aren't actually different owing to the differences in how were calculated between the two implementations.
I am thankful for the answer. The authors did not publish the code , but just mentioned in the paper that the initial values were used as follows. I tried to get to the drawing that was obtained but to no avail. In addition, other papers showing the same drawing Exactly (i mentioned in the upper picture)
And, of course, which hardware/OS the code is run on can make such differences altho if multiple folks have shown the same result it probably is pointing to something actually in your implementation that doesn't duplicate what they're doing.
So, clearly your solution isn't matching the references, then... start looking there. I noticed you did specific implementation of the integration, you could begin by using the Matlab builtin Runge-Kutta method that is based on widely used library routines packaged and tweaked by TMW; some similar routine is probably what those researchers used...it would at least give you a different solution path than the one you've taken...
Again, also, I didn't do any real looking at your code for possible coding/logic errors that might explain it, either.
Thank you so much

Sign in to comment.

Answers (0)

Asked:

on 23 Apr 2019

Commented:

on 23 Apr 2019

Community Treasure Hunt

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

Start Hunting!