Update cachematrix.R

A test case has been provided in the comments at the end of the code