I use the following setup on my Mac and iPad for editing .m files:
- SSH enabled on Mac
- For editing the .m files I use Textastic code editor on iPad. It can upload/download the files over SFTP to/from the Matlab directory on my Mac, and can highlight Matlab .m syntax
- Matlab mobile is connected to the Matlab on my Mac in the usual way.
Basically all you need is a code editor on the mobile device and a way to easily transfer the files over e.g. SSH to the right folder. Then you just download the .m file, edit it and put it back.
I assume this setup can be used with Windows and Linux, too.