DOT type element wise multiplication of two 2-D matrices with array expansion (3-D)

2 ビュー (過去 30 日間)
palla
palla 2020 年 2 月 26 日
コメント済み: palla 2020 年 2 月 26 日
I have two 2-d matrices A(100*20) and B(20*100). I want to perform multiplication of each row of A with each column of B element wise and store the result in a 3-d matrix. How can I perform it? Thanks in advance.

採用された回答

Andrei Bobrov
Andrei Bobrov 2020 年 2 月 26 日
out3D = A .* permute(B,[3,1,2]); % for R2016a and later
out3D = bsxfun(@times,A, permute(B,[3,1,2])); % earlier R2016a

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by