help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
maha ismail
il 13 Gen 2015
Commentato: Star Strider
il 13 Gen 2015
help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length
0 Commenti
Risposta accettata
Star Strider
il 13 Gen 2015
Modificato: Star Strider
il 13 Gen 2015
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!