Paul Barry
23 April 2017
We can define two square n x n matrices in R as follows (we take n=2 here).
Amat<-matrix(c(1,2,3,4),ncol=2)
Bmat<-matrix(c(1,3,5,7),ncol=2)
Amat
[,1] [,2]
[1,] 1 3
[2,] 2 4
Bmat
[,1] [,2]
[1,] 1 5
[2,] 3 7
The product of Amat and Bmat in R is given by Amat %*% Bmat
Amat<-matrix(c(1,2,3,4),ncol=2)
Bmat<-matrix(c(1,3,5,7),ncol=2)
Amat%*%Bmat
[,1] [,2]
[1,] 10 26
[2,] 14 38
The app does the following.