If I have a matrix
matrix=Table[RandomInteger[],{i,3},{j,3}]
And I multiply it with
vector={1,3,5}
All three rows change accordingly.
What do I have to do, when I want to change the columns? Is this:
Transpose@matrix*vector//Transpose
the shortest solution, or do you have better ideas? Because
matrix*Transpose@vector
does not work.
vector # & /@ matrix
. $\endgroup$matrix.DiagonalMatrix[vector]
$\endgroup$