Translate matlab to python/numpy [closed]
Asked Answered
M

3

5

I 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.

Mareld answered 17/9, 2010 at 11:10 Comment(0)
M
4

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

Mareld answered 20/9, 2010 at 7:38 Comment(0)
S
9

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')
Sycamore answered 17/9, 2010 at 11:11 Comment(2)
yes, i know this page. Thanks but when you have thousands of lines to convert, it takes too much time.Mareld
You can try to call MATLAB from Python. Check updated answerSycamore
M
4

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

Mareld answered 20/9, 2010 at 7:38 Comment(0)
R
0

Install PyClips

libreMate

  • cd /path/to/libermate-0.4
  • ./libermate.py /path/to/matlabfile.m

This works for me :-)

Rimskykorsakov answered 24/6, 2014 at 4:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.