(A <- matrix(1:6, nrow = 2, ncol = 3, byrow = TRUE))
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 4 5 6
(A <- matrix(1:6, nrow = 2, ncol = 3, byrow = FALSE))
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
Next, enter these commands.
(A <- matrix(c(3, 5, 2, 3), nrow = 2, ncol = 2))
(B <- matrix(c(1, 1, 0, 1), nrow = 2, ncol = 2))
A %*% B
(C <- diag(c(1, 2, 3)))