inverse of a matrix code

r programming assignment 2