fwrite() the data to the file, and fread() it from the file.
Separately from that, when you are dealing with the file I/O in MATLAB, you might be able to use memmapfile(). An example of using that to communicate between sessions is http://www.mathworks.com/help/matlab/import_export/share-memory-between-applications.html
If you have two different MATLAB sessions that are using a file to communicate, you should consider instead using a shared memory segment; see http://www.mathworks.com/matlabcentral/fileexchange/28572-sharedmatrix