Element to element Array Multiplication with all answers.

1 回表示 (過去 30 日間)
Zahid Iqbal Rana
Zahid Iqbal Rana 2014 年 12 月 26 日
コメント済み: Zahid Iqbal Rana 2014 年 12 月 26 日
Let
a=[1 2 3 4 5 6;7 8 9 1 1 2;5 3 7 8 9 2;7 3 4 6 1 9;5 3 8 1 9 3]
B1=[-0.3908 -0.1297 0.7047 0.0591 0.2161 -0.6635]./1000;
I just want to multiply B1 with each row of a (with dot multiplication so element to element multiplication) and than sum of all entries of each row. Final answer should be of the order of 5x1. Please tell me how i can get the answer.

採用された回答

Shoaibur Rahman
Shoaibur Rahman 2014 年 12 月 26 日
c = bsxfun(@times,a,B1)
out = sum(c,2)

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by