Update cachematrix.R

This code was tested on 18 Nov 2014.