3 matrix product without dimension error
1 回表示 (過去 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!