This project demonstrates how to integrate MATLAB and Python, with a focus on calling Python from MATLAB. It is designed for educational purposes, especially for MATLAB users interested in leveraging Python libraries and code.
matlab/
— MATLAB scripts demonstrating Python integrationpython/
— Python scripts and modules for use with MATLAB
- MATLAB R2014b or later (for Python integration)
- Python 3.x installed and accessible from MATLAB
- (Optional) An environment manager like Anaconda
- Ensure Python is installed and accessible from MATLAB:
pyenv('Version', 'C:/Path/To/python.exe')
- Install required Python packages:
pip install -r python/requirements.txt
- Open MATLAB and run scripts in the
matlab/
folder. These scripts demonstrate calling Python functions, using Python libraries, and exchanging data.
- See the
python/
folder for examples of calling MATLAB from Python using the MATLAB Engine API for Python.
- Calling Python functions from MATLAB
- Using Python libraries (e.g., NumPy, matplotlib) in MATLAB
- Exchanging data between MATLAB and Python
- (Bonus) Calling MATLAB from Python
For more details, see the example scripts in each folder.