I tried these options too as suggested by Paul... >>> h.Execute ("run('H:\\rishika\\MATLAB\\filewrite.m')") '??? Error using run (line 41)\nH:\\rishika\\MATLAB\\filewrite.m not found.\n\n' >>> h.Execute ("run(r'H:\rishika\MATLAB\filewrite.m')") '??? Error: Unexpected MATLAB expression.\n\n