What problem does it solve?
Calling Python from MATLAB often fails with ModuleNotFoundError, unconfigured pyenv environments, type mismatches, or outdated syntax like pyargs and pyversion. This Skill provides the correct modern APIs, environment setup procedures, and structured error recovery so MATLAB-to-Python integration works reliably.
Core Features & Use Cases
- Modern Python Interop Syntax: Enforces name=value keyword arguments, int32/int64 type wrapping, and pystringarray for string arrays instead of deprecated pyargs and pyversion.
- Environment Setup and Recovery: Guides Python installation, virtual environment creation, pip package installation, and pyenv configuration with a structured triage procedure for ModuleNotFoundError and unresolved py.* errors.
- Execution Mode Management: Explains InProcess vs OutOfProcess execution, module reloading, and safe use of terminate(pyenv) with user confirmation.
- Use Case: A MATLAB script calling sklearn fails with "Unable to resolve the name 'py.sklearn'". The Skill triages the error, checks pyenv().Executable, creates a virtual environment, installs scikit-learn via pip, and reconfigures MATLAB to run the code successfully.
Quick Start
Ask the agent to call a Python library such as numpy or sklearn from MATLAB, or to fix a ModuleNotFoundError occurring in MATLAB Python code.