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)
cat('\n')
print(m2)
cat('\n')
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,] 12 3 3
# [2,] 7 1 4
# [3,] 11 1 8
#