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. – Szabolcs Oct 06 '15 at 09:39matrix.DiagonalMatrix[vector]– user1066 Jun 07 '17 at 23:40