フィルターのクリア

help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length

1 回表示 (過去 30 日間)
help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length

採用された回答

Star Strider
Star Strider 2015 年 1 月 13 日
編集済み: Star Strider 2015 年 1 月 13 日
Use bsxfun:
m = rand(10,5);
v = rand(10,1);
vm = bsxfun(@times, v, m);
Here, ‘m’ is the matrix, ‘v’ is the vector, and ‘vm’ is the element-by-element product of the columns of ‘m’ and column vector ‘v’.
  4 件のコメント
maha ismail
maha ismail 2015 年 1 月 13 日
Thanks for your answers. ..yes it works

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by