# Matrix operation a = matrix(c(1, 2, 3, 4), nrow = 2, ncol = 2, byrow = TRUE) b = matrix(c(5, 6, 7, 8), nrow = 2, ncol = 2, byrow = TRUE) print(a) print(b) # Addition sum.ab = a + b print(sum.ab) # Subtract diff.ab = a - b print(diff.ab) # Multiplication mult.ab = a * b print(mult.ab) # Division div.ab = a / b print(div.ab) # Inverse solve(a) solve(b) # Transpose t(a) t(b)