multiply matrices with different dimensions with loop

2 vues (au cours des 30 derniers jours)
Nuria Mata
Nuria Mata le 2 Déc 2020
Commenté : Nuria Mata le 2 Déc 2020
Hello, I have two matrices A of [1532x84] and B of [84x1], and I have to multiply them to obtain a matrix C of [1532x84]. How can I create a loop where to multiply each row of A by column of B with Matlab?

Réponses (1)

James Tursa
James Tursa le 2 Déc 2020
Is this what you want?
C = A .* B.';
  2 commentaires
John D'Errico
John D'Errico le 2 Déc 2020
Silly. You were supposed to use a loop. :)
for ind = 1:1
C = A .* B.';
end
Sorry. I had to say it.
Nuria Mata
Nuria Mata le 2 Déc 2020
Thank you it worked with the for loop

Connectez-vous pour commenter.

Catégories

En savoir plus sur Loops and Conditional Statements 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