DOT type element wise multiplication of two 2-D matrices with array expansion (3-D)
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
palla
am 26 Feb. 2020
Kommentiert: palla
am 26 Feb. 2020
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.
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 26 Feb. 2020
out3D = A .* permute(B,[3,1,2]); % for R2016a and later
out3D = bsxfun(@times,A, permute(B,[3,1,2])); % earlier R2016a
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!