Use dynamic memory in the heap for matrices. Similar to HW4.