error in Correlation Coef

6 ビュー (過去 30 日間)
Seemab  Janjua
Seemab Janjua 2016 年 11 月 23 日
コメント済み: Seemab Janjua 2016 年 11 月 23 日
i am using code
ddt=randn(10,3); ddm=randn(10,1); nd=size(ddt,2); for i=1:nd tw(i) = corrcoef(ddt(:,i),ddm);
end;
but getting error " In an assignment A(I) = B, the number of elements in B and I must be the same.
tw(i) =
corrcoef(ddt(:,i),ddm); how to get rid off this error .

採用された回答

Walter Roberson
Walter Roberson 2016 年 11 月 23 日
When you pass in two variables to corrcoeff the output is a 2 by 2 numeric array, not a scalar.
  1 件のコメント
Seemab  Janjua
Seemab Janjua 2016 年 11 月 23 日
thanks sir. it works...

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHilbert and Walsh-Hadamard Transforms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by