added code for cacheMatrix

Added R code for cacheMatrix but did not add comments yet.