Update cachematrix.R

Copied functions from R Studio