I have this R code:
> coef [1] 1.5 2.4 3.9 4.4 > y [,1] [,2] [,3] [,4] [1,] 1 2 12 45 [2,] 5 6 7 8 [3,] 9 10 2 12
apply(y, 1, "*", coef) # -- result -- [,1] [,2] [,3] [,4] [,5] [1,] 1.5 7.5 13.5 19.5 25.5 [2,] 4.8 14.4 24.0 33.6 43.2 [3,] 46.8 27.3 7.8 58.5 152.1 [4,] 198.0 35.2 52.8 198.0 30.8