P <- matrix(c(3:14), nrow = 4, byrow = TRUE) print(P) #Access the element at the 3rd column and the 1st row. print(P[1,3]) #Access the element at the 2nd column and the 4th row. print(P[4,2]) Q <- matrix(c(14:25), nrow = 4, byrow = TRUE) print(Q) print(P+Q) print(P-Q) print(P*Q) print(P/Q)
To embed this project on your website, copy the following code and paste it into your website's HTML: