The problem of autocorrelation function
Show older comments
According to a differential equation in matlab, the time series x(t) is obtained. To obtain the autocorrelation result of the following figure, xs(t)=x(t-s), s is also a variable, how to write a program in matlab.

Answers (1)
Image Analyst
on 5 Sep 2021
Isn't it just
autoCorrelation = xcorr(x, x);
but that seems so obvious so I'm wondering if this is your homework problem and you have to not use the MATLAB function and write your own version of it. If so, read the following link:
If it's not homework, xcorr() should work for you.
5 Comments
wenxin liu
on 5 Sep 2021
Edited: wenxin liu
on 5 Sep 2021
wenxin liu
on 5 Sep 2021
Image Analyst
on 5 Sep 2021
What differential equation? Your first sentence of your original post about differential equation has nothing to do with the rest of the post about correlation. You don't even show any differential equation, just an equation for correlation.
And how did you define your (badly-named) "a" and "b"?
What is the time difference between two samples?
wenxin liu
on 6 Sep 2021
wenxin liu
on 6 Sep 2021
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
