How can I calculate the rolling cross covariance of two vectors in MATLAB 7.8 (R2009a)?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 12 de Mayo de 2011
Editada: MathWorks Support Team
el 18 de Oct. de 2019
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
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.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!