matlab code for autocorrelation function

Status
Not open for further replies.

afifar

Newbie level 5
Joined
Dec 7, 2012
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,327
i wanna ask about matlab code for autocorrelation function.

if an input is wide-sense stasioner with autocorrelation function is RXX(t)=10e^(-2|t|).

what is matlab code for that function ?
 

If you are asking the code to compute that Rxx(t) function it is very easy to do that in Matlab:

Code:
% Define range of t in the interval [-1;1] with steps of 0.01
t = [-1:.01:1];
% Compute the function with input vector t (with absolute values)
R = 10 * exp(-2 * abs(t));
 



Is that all ? how can i decide the mean of output ?
 
Last edited:

Yes, that's all! This is Matlab ;-)

To get the average of a vector (in this case R), just use the following built-in function

Code:
avg = mean(R);
 
Reactions: afifar

    afifar

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…