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 CenterFile Exchange에서 Hilbert 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