multiply col vector with matrix

2 vues (au cours des 30 derniers jours)
Aravin
Aravin le 5 Avr 2012
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.

Réponse acceptée

Junaid
Junaid le 5 Avr 2012
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.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by