Update cachematrix.R

Assignment 2 from Coursera course "R Programing"