I would like to do something like this Let say I have a matrix A of size 3×4
A =
0 1 2 3 1 0 0 0 5 0 1 0and a vector v of size 3x1v = 3 5 2there is any way that I can produce an elementwise product as:A v = 3*[ 0 1 2 3] 0 3 6 9 5*[ 1 0 0 0]= 5 0 0 0 2*[ 5 0 1 0] 10 0 2 0without a loop?
Best Answer