cross-correlation between a vector and and rows of a matrix

16 ビュー (過去 30 日間)
Paola
Paola 2021 年 9 月 22 日
回答済み: Chunru 2021 年 9 月 23 日
Hi,
I would like to cross-correlate a vector (x) with each row of a matrix (26X5501). Is it possible to do that? which function can I use.
I tried xcorr but it didn't work for me.
Thanks

回答 (1 件)

Chunru
Chunru 2021 年 9 月 23 日
x = randn(40, 5); % better to make it column dominant order for speed
y = circshift(x(:,1), 5);
for i=1:size(x, 2)
[c{i},lags] = xcorr(x(:, i),y);
end
plot(lags, c{1})

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by