Function to create special matrix object
Merge https://github.com/timgodin10/ProgrammingAssignment2