Skip to main content

MATLAB wrapper for Python

Project description

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

Warning: matlab_wrapper is maintained, but not actively developed. Consider using the official MATLAB Engine for Python, forking the repository, or using alternatives mentioned in the FAQ.



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

More examples are in the examples directory!


  • Access MATLAB variables and functions from Python
  • Multiplatform: GNU/Linux, Windows, OS X
  • On-the-fly conversion between MATLAB and Numpy data types
  • Support for MATLAB’s numerical, logical, struct and cell arrays
  • Pure Python, no need to compile anything (matlab_wrapper talks to MATLAB engine library using ctypes)

For a complete list of changes including new features, check the NEWS.rst file.


First, make sure that you have the following components installed:

  • Python (2.7, no Python 3 support yet)
  • MATLAB (various versions)
  • Numpy

Next, install matlab_wrapper using pip (the standard Python package installation tool) from your command line:

pip install matlab_wrapper


Check our CONTRIBUTING guidelines.


If you are having issues, please let us know through the issue tracker: Please avoid duplicates by searching previous issues, checking FAQ and CONTRIBUTING.


matlab_wrapper was forked from pymatlab.

MATLAB is a registered trademark of The MathWorks, Inc.


The project is licensed under the GNU General Public License v3 or later (GPLv3+).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
matlab_wrapper-0.9.8.tar.gz (32.5 kB) Copy SHA256 hash SHA256 Source None Jan 24, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page