필터 지우기
필터 지우기

how to caculate covariance matrix?

조회 수: 3 (최근 30일)
bay rem
bay rem 2015년 12월 10일
댓글: Walter Roberson 2015년 12월 10일
i tried to calculate covariance of matrix but an error appeared:
here is my matrix (3*3):
m=
26 197 27 197 28 197
26 196 27 196 28 196
26 195 27 195 28 195
where(26,197) describe piwel's position
and this is the error:
Error using bsxfun
Mixed integer class inputs are not supported.
Error in cov (line 154)
xc = bsxfun(@minus,x,sum(x,1)/m); % Remove mean
Error in fourptm (line 155)
c=cov(m)

채택된 답변

Walter Roberson
Walter Roberson 2015년 12월 10일
  댓글 수: 2
bay rem
bay rem 2015년 12월 10일
thank you so much i already tried it, but Is it right to find such result:
0 0 0 0 0 0
0 1 0 1 0 1
0 0 0 0 0 0
0 1 0 1 0 1
0 0 0 0 0 0
0 1 0 1 0 1
Walter Roberson
Walter Roberson 2015년 12월 10일
Yes.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by