Using MATLAB with Python

MATLAB® provides a flexible, two-way integration with many programming languages, including Python. This allows different teams to work together and use MATLAB algorithms within production software and IT systems.

Calling MATLAB from Python

The MATLAB Engine API for Python allows you to call MATLAB as a computational engine from Python.

The API lets you execute MATLAB commands from within your Python environment without starting a desktop session of MATLAB. Learn more about the MATLAB Engine API for Python.

Calling Python Libraries from MATLAB

If you have functions and objects in Python, you can call them directly from MATLAB.

This allows you to work entirely within MATLAB without switching your programming environment. Learn more about calling Python libraries from MATLAB.

Packaging MATLAB Programs for Scalable Deployment with Python

Write algorithms and applications in MATLAB, and package and share them with just one click. You can build Python packages from MATLAB programs by using MATLAB Compiler SDK™. These packages can be integrated with Python applications that, in turn, can be shared with desktop users or deployed to web and enterprise systems, royalty-free. Learn more about integrating compiled MATLAB programs into Python applications.

Scale up your MATLAB programs to concurrently access and serve a system of databases, web, and enterprise applications by deploying the programs to MATLAB Production Server™. The server provides integration within your IT architecture via lightweight client API libraries (that include Python) and a RESTful/JSON interface.


Using MATLAB with Python for Deep Learning

It’s not an either/or choice between MATLAB® and Python-based frameworks. MATLAB supports importing and exporting open source deep learning frameworks with the Open Neural Network Exchange (ONNX) format. You can also import models directly from TensorFlow and PyTorch. This allows you to use MATLAB’s data labeling apps, signal processing, and GPU code generation with the latest deep learning research from the community.

Pass data between MATLAB and Python with Parquet

Use Apache Parquet to store and transfer tabular data between MATLAB and Python. MATLAB efficiently reads and writes data in Parquet files using Apache Arrow.

Learn More

Learn how to call MATLAB from Python, call Python from MATLAB, and create Python packages.