The product of a vector and a matrix
6 ビュー (過去 30 日間)
古いコメントを表示
I have a vector A = and a matrix X = , where is a M-dimensional row vector. Does matlab have an operator that directly give me the matrix? (where each row vector in the above matrix X is multiplied by the corresponding part in vector A)
0 件のコメント
採用された回答
Dyuman Joshi
2023 年 12 月 8 日
編集済み: Dyuman Joshi
2023 年 12 月 8 日
If I understand your question correctly, you should get the desired output using array multiplication -
N=5;
A = (1:N).'
X = magic(N)
Z = A.*X
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!