To call Python libraries from MATLAB, install a supported version of the reference implementation (CPython) for Python. MATLAB supports versions 2.7, 3.5, and 3.6. The version you install depends on the libraries you are using. For information, see Install Supported Python Implementation.
To call a Python function, type
py. in front of
the module name and function name. Pass MATLAB data as arguments to Python function; MATLAB converts the data into types that best represent the data to the
Python language. For example,
the contents of the current folder.
For help on the Python language, see
For help on third-party or user-defined modules, refer to the product
To call MATLAB functions from Python applications, see MATLAB API for Python.
|Change default version of Python interpreter|
|Capture error information for Python exception|
How to verify you have installed a supported version of Python.
Different behaviors between MATLAB variables and Python objects.
How to find help for Python functions.
How to use Python
import statements and MATLAB
Create a Python module used by examples in this documentation.
This example shows how to reload a modified Python module.
How to install a supported version of Python from
Python features not supported in MATLAB.
Troubleshooting failures loading Python.
MATLAB types that are not supported in Python.
Python types that do not have compatible MATLAB types.
Error might be caused by input array with more than one non-singleton dimension.
Indexing features not supported in MATLAB.
MATLAB catches exceptions thrown by Python and
converts them into a
Tips to determine if an error originates in Python or MATLAB code.