Update cachematrix.R

Added code for Programming with R assignment #2