Cross correlation of several rows within a matrix

조회 수: 2 (최근 30일)
Ben
Ben 2020년 5월 6일
Hola!
I have a matrix of 10 column, each column has measurements at different times. I have a second matrix also of 10 columns, each consisting of measurements at different times.
I want to carry out cross correlations of every combination within this matrix. Example, xcorr row 1 matrix 1 with row 1 of matrix 2, then row 1 of matrix 1 of row 2 of matrix 2 and so on. I would like correlations and time lag for each and every combination of columns.
I currently do this, but it means I have to do each row seperatly which is very time consuming.
[xc,lags] = xcorr(matrix1(:,1),matrix(:,2));
[~,I] = max(abs(xc));figure;
plot(lags,xc); legend(sprintf('Time delay %d',lags(I))); title('Column 1 matrix 1 xcorr with Column 2 matrix 2')
Gracias todos, Ben :)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by