Can I multiply a Vector with a Matrix?

33 ビュー (過去 30 日間)
Edoardo
Edoardo 2012 年 10 月 29 日
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 件のコメント
Matt J
Matt J 2012 年 10 月 29 日
編集済み: Matt J 2012 年 10 月 29 日
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?

サインインしてコメントする。

採用された回答

Jan
Jan 2012 年 10 月 29 日
In the expression A*B the number of columns of A must equal the number of rows of B.
  1 件のコメント
Edoardo
Edoardo 2012 年 10 月 29 日
Thanks :)

サインインしてコメントする。

その他の回答 (1 件)

Matt J
Matt J 2012 年 10 月 29 日
In the expression A.*B, the matrices A and B must have the same number of rows and columns.
  1 件のコメント
Edoardo
Edoardo 2012 年 10 月 29 日
Thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by