Update cachematrix.R

Committing the code for coursera R programming assignment 2