write.mat-methods function

Write Matlab file