Displaying 1 result from an estimated 1 matches for "semajor".
2011 Aug 06
4
row*matrix
Hi all, I'm learning R. I'm used to Matlab and am having the following issue:
I define a column vector and matrix and then multiply them. The result is
not what I expect:
v2 <- c(0,1,0)
M <- cbind(c(1,4,7),c(2,5,8),c(3,6,9))
M*v2
[,1] [,2] [,3]
[1,] 0 0 0
[2,] 4 5 6
[3,] 0 0 0
I expect the result to be a column, specifically the 2nd column of M.