Multiplication between matrices with different dimensions

3 ビュー (過去 30 日間)
stelios loizidis
stelios loizidis 2021 年 1 月 12 日
回答済み: Doddy Kastanya 2021 年 1 月 12 日
Hello. I have the following issue: I have the matrix H which has a size of 353X25. Next I calculate the pseudo-inverse H_inv (25X353). I multiply the H_inv matrix by the matrix Data which has size 353Χ24. However, the interations cannot be continued because the result obtained from the multiplication (Res matrix) of the H_inv and Data is a 25x24 matrix. How can this problem be solved so that the Res matrix has all the results emerges. That is, to have dimensions: 8472X24? Your help is important.
Below is the code:
for w=1:353
H_inv(i,:)=pinv(H(i,:)); % H-(353X25)
Res(i,:)=H_inv*Data(i,:); %w=1 Res(25X24)
end

回答 (1 件)

Doddy Kastanya
Doddy Kastanya 2021 年 1 月 12 日
Your loop is in terms of "w"; however, in the loop "w" is not used at all. Shouldn't "i" be "w"?
The pseudoinverse matrix can be executed on the whole matrix instead of just on each row of the matrix. So, why don't you just use H_inv=pinv(H)? Finally, given the size of the H_inv and Data, the Res matrix should have a size of 25x24 instead of 8472x24.

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by