Added all the code I need for matrix file read and write. Now debugging.
Debugged the matwrite and matread functions. Seem to be working now.