help with multiplying matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I have 100 6*6 matrices and one 1*100 matrices. i want to multiply the number on the 1x100 matrices with the corresponding 6x6 matrices as shown in the picture below. how can i do that?
thanks for the help
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/378236/image.png)
0 件のコメント
採用された回答
Ameer Hamza
2020 年 10 月 12 日
編集済み: Ameer Hamza
2020 年 10 月 12 日
If you use a recent version of MATLAB which support implicit array expansion
M; % 6x6x100 matrix
v; % 1x100 vector
M_new = M.*reshape(v, 1, 1, []);
on older versions
M_new = bsxfun(@times, M, reshape(A,1,1,[]))
0 件のコメント
その他の回答 (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!