Can I multiply a Vector with a Matrix?

68 visualizzazioni (ultimi 30 giorni)
Edoardo
Edoardo il 29 Ott 2012
Hi;
Sorry for my english. I've a big problem, I want multiply a vector by a matrix:
ES: A=< 1x1250 double >; B= is a matrix < 421x421 double >;
C=A*B; ??? Error using ==> Inner matrix dimensions must agree
or if
C=A.*B; ??? Error using ==> times Matrix dimensions must agree.
Please help me!!! Thanks
  1 Commento
Matt J
Matt J il 29 Ott 2012
Modificato: Matt J il 29 Ott 2012
What are the dimensions of B and do you want element-wise multiplication C(i)=A(i).*B(i) or do you want matrix-sense multiplication?

Accedi per commentare.

Risposta accettata

Jan
Jan il 29 Ott 2012
In the expression A*B the number of columns of A must equal the number of rows of B.

Più risposte (1)

Matt J
Matt J il 29 Ott 2012
In the expression A.*B, the matrices A and B must have the same number of rows and columns.

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by