vec <- c(1, 2, 3, 1, 0, 2, 3, 1, 1)
m1 <- matrix(vec, nrow = 3, ncol = 3)
vec <- c(2, 1, 3, 0, 0, 1, 2, 1, 0)
m2 <- matrix(vec, nrow = 3, ncol = 3)
mul <- m1 * m2
print(m1)
print(m2)
print(mul)
# run:
#
# [,1] [,2] [,3]
# [1,] 1 1 3
# [2,] 2 0 1
# [3,] 3 2 1
# [,1] [,2] [,3]
# [1,] 2 0 2
# [2,] 1 0 1
# [3,] 3 1 0
# [,1] [,2] [,3]
# [1,] 2 0 6
# [2,] 2 0 1
# [3,] 9 2 0
#