multiply columns of an Array

1 回表示 (過去 30 日間)
Nikolas Spiliopoulos
Nikolas Spiliopoulos 2017 年 1 月 11 日
コメント済み: Sean de Wolski 2017 年 1 月 11 日
Hi all, I am a beginner in Matlab and I am struggling with something.
Lets say I have: A= [1 2 1;3 1 1]; B= [1; 2]
i need to multiply the columns of A with B elements and get this result : c= [1*1 2*1 1*1 ; 3*2 1*2 1*2]
any ideas?
Thanks in Advance!
Nikolas

採用された回答

KSSV
KSSV 2017 年 1 月 11 日
iwant = bsxfun(@times,A,B)

その他の回答 (1 件)

Alexandra Harkai
Alexandra Harkai 2017 年 1 月 11 日
bsxfun(@times, A, B)
Or in R2016b:
A * B
  1 件のコメント
Sean de Wolski
Sean de Wolski 2017 年 1 月 11 日
A.*B

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

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by