Fixed matlab output and file reading

matlab file was writing ascii data of decimal number, not binary 4 byte
per number data. Also, file input function was refactored with pointers
to pass non-array variables by reference. May need to look into this
more for the other functions, since I wasn't thinking about non-arrays
not being passed by reference in C.