skip to navigation
skip to content

matlab_wrapper 0.7

MATLAB wrapper for Python

Package Documentation

Latest Version: 0.9.8

MATLAB wrapper for Python

Author:Marek Rudnicki
License:GNU General Public License v3 or later (GPLv3+)


matlab_wrapper allows you to use MATLAB in an convenient way from your Python scripts and interactive shell. MATLAB session is started in the background and appears as a regular Python module.

matlab_wrapper talks to MATLAB engine library using ctypes, so you do not have to compile anything!



import matlab_wrapper
matlab = matlab_wrapper.MatlabSession()

Low level:

matlab.put('a', 12.3)
matlab.eval('b = a * 2')
b = matlab.get('b')


s = matlab.workspace.sin([0.1, 0.2, 0.3])

sorted,idx = matlab.workspace.sort([3,1,2], nout=2)

matlab.workspace.a = 12.3
b = matlab.workspace.b


  • Python (2.7)
  • Matlab (tested with 2013b)
  • Numpy (1.8)


  • GNU/Linux (working, well supported)
  • Windows (working, supported)
  • OSX (unknown)

Note: I have tested only 64-bit systems. If you are interested in 32-bit version, please contact me per email or open an issue on GitHub.

The library should work on OSX with just small changes. Unfortunately, I have no way to test it. If you would like support for OSX, please contact me.


pip install matlab_wrapper


(last updated on June 17, 2014)

  • pymatlab
    • pure Python, no compilation, using ctypes (good)
    • quite raw (ugly)
    • memory leaks (bad)
  • mlabwrap
    • cool interface, mlab.sin() (good)
    • needs compilation (bad)
    • not much development (bad)
  • mlab
    • similar interface to mlabwrap (good)
    • using raw pipes (hmm)
    • there is another very old package with the same name (ugly)
  • pymatbridge
    • actively developed (good)
    • client-server architecture with ZeroMQ and JSON, complex (ugly)
    • missing basic functions, there’s no put (bad)
    • nice ipython notebook support (good)


matlab_wrapper was forked from pymatlab.

File Type Py Version Uploaded on Size
matlab_wrapper-0.7.tar.gz (md5) Source 2014-06-25 21KB