Skip to content

Matrix element-by-element multiplication

2 messages · Steven Yen, R. Michael Weylandt

#
Did you even try?

a <- 1:3
x <-  matrix(c(1,2,3,2,4,6,3,6,9),3)
a*x

     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    8   12
[3,]    9   18   27

Michael
On Fri, Nov 4, 2011 at 7:26 PM, Steven Yen <syen at utk.edu> wrote: