Update cachematrix.R

Written to be the same code structure as makeVector and cachemean.