Update cachematrix.R

Created the function logic for the 2 functions, per instructions for Programming Assignment 2