Skip to main content

MATLAB wrapper for Python

Project description

MATLAB wrapper for Python

Description

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

matlab_wrapper uses standard MATLAB engine library and talks directly to the binaries through ctypes. You do not need to compile anything!

Usage

Initialize:

import matlab_wrapper
matlab = matlab_wrapper.MatlabSession()

Low level:

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

Workspace:

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

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

Requirements

  • Python (2.7)

  • Matlab (tested with 2013b)

  • Numpy (1.8)

Installation

pip install matlab_wrapper

Limitations

  • Struct arrays are not yet supported.

  • Support on Windows and OSX is not as good as on GNU/Linux (I’m looking forward to contributors).

Issues and Bugs

https://github.com/mrkrd/matlab_wrapper/issues

Alternatives

  • 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, either get or put (bad)

    • nice ipython notebook support (good)

Acknowledgments

matlab_wrapper was forked from pymatlab.

Project details


Download files

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

Source Distribution

matlab_wrapper-0.5.tar.gz (20.5 kB view details)

Uploaded Source

File details

Details for the file matlab_wrapper-0.5.tar.gz.

File metadata

  • Download URL: matlab_wrapper-0.5.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for matlab_wrapper-0.5.tar.gz
Algorithm Hash digest
SHA256 b909b597bfdaf5632bc565fea90618eff365d463492d456ef932c513b15d023f
MD5 b37f797ba95e2b9e95052085c73a73f2
BLAKE2b-256 f6d734f3a3b65bdbe9b19bcf6adaf96b5abcd578828538aa4de0de74e094763b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page