How do I multiply matrices having elements as vectors?
Mostra commenti meno recenti
A*B doesn't work A.*B doesn't work either since it multiplies them element by element
3 Commenti
Adam
il 2 Giu 2015
Can't you give an example together with your expected result. I don't really understand what you are asking. Just saying things "don't work" is not a very useful piece of information. Do you mean you get a syntax error or the wrong answer?
Adam
il 2 Giu 2015
So what is your expected result?
Risposte (1)
Matthew Eicholtz
il 2 Giu 2015
0 voti
If I understand the question correctly, you are asking how to multiply two vectors of the same size.
Without loss of generality, let's assume A and B are 1x10 vectors. A*B will not work because the inner dimensions do not match (1x10 * 1x10). A.*B will only multiply each pair of elements as you noticed, yielding a 1x10 result.
Two potential solutions:
- dot(A,B)
- A*B'
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!