Update cachematrix.R

Please find the solution to assignment 2 with comments and example of use