How can I correlate rows of a matrix to a vector template ?

1 回表示 (過去 30 日間)
EK
EK 2018 年 9 月 16 日
編集済み: Stephen23 2018 年 9 月 16 日
Hi, I have a matrix Y with 6 colomns and n rows. I need to calculate correlation between each row in a matrix and a given vector X (template of 0 and 1). For erample 0 0 0 1 1 1. Can anyone help me with that? Many thanks in advance, Helen
  2 件のコメント
Akira Agata
Akira Agata 2018 年 9 月 16 日
Have you already tried xcorr function ?
Stephen23
Stephen23 2018 年 9 月 16 日
編集済み: Stephen23 2018 年 9 月 16 日
Elena's "Answer" moved here and formatted correctly:
I tried that not sure if its correct
X=[ 5 6 7 8 9 10];
Y=[ 1 1 1 1 3 3;
1 1 1 4 3 3;
6 6 6 1 3 3;
1 1 1 1 3 3;
1 1 1 1 8 3;
1 1 1 1 3 3;
1 1 1 5 3 3;
1 1 1 1 3 3;
6 6 6 6 1 1];
rank = nan(1,6);
for i=1:6
C = xcorr(X, Y(i,:));
rank(i) = C(1,2);
end

サインインしてコメントする。

回答 (0 件)

カテゴリ

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