How do I multiply matrices having elements as vectors?
2 ビュー (過去 30 日間)
古いコメントを表示
A*B doesn't work A.*B doesn't work either since it multiplies them element by element
3 件のコメント
回答 (1 件)
Matthew Eicholtz
2015 年 6 月 2 日
If I understand the question correctly, you are asking how to multiply two vectors of the same size.
Without loss of generality, let's assume A and B are 1x10 vectors. A*B will not work because the inner dimensions do not match (1x10 * 1x10). A.*B will only multiply each pair of elements as you noticed, yielding a 1x10 result.
Two potential solutions:
- dot(A,B)
- A*B'
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!