#matrix operations 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) #adding of matrices sum.ab<-a+b print(sum.ab) #subtracting of matrices dif.ab<-a-b print(dif.ab) #multiply mul.ab<-a*b print(mul.ab) #inverse solve(a) solve(b) #transpose of a matrix t(a) t(b)