Install SMOP: $ git clone https://github.com/victorlei/smop $ cd smop $ python setup.py install --user then run: $ smop file.m this will convert file.m in file.py