Translate matlab to python/numpy [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answer开发者_开发知识库ed with facts and citations.
Closed 7 years ago.
Improve this questionI am looking for an automatic code translator for Matlab to Python. I downloaded and installed LiberMate but it is not documented anywhere and I wasn't able to make it work.
Has anybody dealt with this kind of challenge before? Any advice welcome.
I've done it manually. Check this.
[EDIT]
You can also try to call your MATLAB code from Python using Mlabwrap, a high-level Python to MATLAB bridge that lets MATLAB look like a normal Python library.
For example:
from mlabwrap import mlab
mlab.plot([1,2,3], '-o')
i seems there is no other way than to do the translation manually. I suggest you have these pages in your browser meanwhile:
http://www.mathworks.com/help/techdoc/ with: http://www.scipy.org/Numpy_Example_List_With_Doc
and: Link with: http://mathesaurus.sourceforge.net/matlab-numpy.html
Install PyClips
- wget http://sourceforge.net/projects/pyclips/files/pyclips/pyclips-1.0/pyclips-1.0.7.348.tar.gz/download
- tar zxvf download
- cd pyclips
- ./setup.py install
libreMate
- cd /path/to/libermate-0.4
- ./libermate.py /path/to/matlabfile.m
This works for me :-)
精彩评论