I have 3*3*20 matrix and 1*1*20 matrix. how to multiply. I have multiply q and za
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Triveni
am 21 Jul. 2015
Bearbeitet: Triveni
am 15 Mär. 2016
q(:,:,1:20); %3*3 Matrix
za(1:20); % 1*1 Matrix
How to multiply q and za. Error using q*za or q.*za
0 Kommentare
Akzeptierte Antwort
Titus Edelhofer
am 21 Jul. 2015
Hi Ranjan,
if you want to multiply each 3x3 Matrix q(:,:,idx) with the corresponding za(1,1,idx), then this should work:
q = rand(3,3,20);
za = rand(1,1,20);
result = bsxfun(@times, q, za);
Titus
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!