3 matrix product without dimension error
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi all
I have a x with 2*72 dimensions and want to product the x(i)'*W*x(j) that W is inv(cov(x)) and 72*72.
I write it:
H=zeros(n,n);
for i=1:n
for j=1:n
H(i,j)=x(:,i)'*W*x(:,j);
H(j,i)=H(i,j);
end
end
but i receive dimension errors
please help me.
댓글 수: 0
답변 (2개)
Walter Roberson
2021년 7월 2일
x is 2x72. indexing one column of it gives 2x1. Transpose gives 1x2. That does not match the 72x72 of W.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!