multiply col vector with matrix

I have matrix and one column vector. I want to multiply column vector with each of column in matrix.
Let say matrix is M and column is N, I want to multiply N with each column of M.

 採用された回答

Junaid
Junaid 2012 年 4 月 5 日

1 投票

You can do it like this.
bsxfun(@times,M,N)
If N is column vector then each colmn in M is multiplied by N, else if N is row vector then each row in M is multiplied by N.

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2012 年 4 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by