Effacer les filtres
Effacer les filtres

I have 3*3*20 matrix and 1*1*20 matrix. how to multiply. I have multiply q and za

1 vue (au cours des 30 derniers jours)
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

Réponse acceptée

Titus Edelhofer
Titus Edelhofer le 21 Juil 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

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by