Update cachematrix.R

first commit based on sample mean code