Update cachematrix.R

Copied from Branch PA2