How can I calculate the rolling cross covariance of two vectors in MATLAB 7.8 (R2009a)?

1 visualización (últimos 30 días)
I would like to calculate the rolling cross covariance of two vectors:
where R_i is the running cross correlation of two signals centered with i-th time with the window length (-n, n).

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 18 de Oct. de 2019
A function to compute the rolling cross covariance as defined in your equation is not available in MATLAB 7.8 (R2009a).
As a workaround you can consider two possible implementations:
1) Use a FOR loop and apply the MATLAB CORRCOEF function iteratively on your signals.
2) Build a function that implements the rolling cross covariance by using vectorized operations.
Both approaches are called in the attached scripts.m file. The second approach is implemented in the rollingCorr function.

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by