Update cachematrix.R

Programming Assignment2 for the R programming course.