Update cachematrix.R

Updated file to complete R Programming Assignment 2