Contenu principal

Appeler MATLAB à partir de Python

Écrire des programmes Python® qui fonctionnent avec MATLAB®

MATLAB Engine API pour Python propose un package pour que Python appelle MATLAB en tant que moteur de calcul. Le moteur supporte l’implémentation de référence (CPython). Pour plus d’informations sur les versions supportées, consultez Versions of Python Compatible with MATLAB Products by Release (Versions de Python compatibles avec les produits MATLAB par version).

Les applications Engine nécessitent une version installée de MATLAB. Vous ne pouvez pas exécuter MATLAB Engine sur un ordinateur seulement équipé de MATLAB Runtime.

Fonctions

développer tout

matlab.engine.start_matlabStart MATLAB Engine for Python
matlab.engine.find_matlabFind shared MATLAB sessions to connect to MATLAB Engine for Python
matlab.engine.connect_matlabConnect shared MATLAB session to MATLAB Engine for Python
matlab.engine.shareEngineConvert running MATLAB session to shared session
matlab.engine.engineNameReturn name of shared MATLAB session
matlab.engine.isEngineSharedDetermine if MATLAB session is shared

Classes

développer tout

matlab.engine.MatlabEnginePython object using MATLAB as computational engine within Python session
matlab.engine.FutureResultResults of asynchronous call to MATLAB function stored in Python object

Rubriques

Installation

  • Installer MATLAB Engine API pour Python
    MATLAB Engine API pour Python permet d’appeler des fonctions MATLAB et d’exécuter des commandes MATLAB depuis un environnement Python. Pour utiliser le moteur MATLAB, vous devez avoir installé une version supportée de Python sur votre machine. Vous devez également installer MATLAB Engine API pour Python en tant que package Python.

Pour commencer

Gestion des sessions

Utiliser l’espace de travail MATLAB

Échange et mapping de données

Appeler des fonctions MATLAB

Résolution des problèmes

Limitations to MATLAB Engine API for Python

MATLAB Engine API for Python does not support these features.

Troubleshoot MATLAB Errors in Python

When a MATLAB function raises an error, the MATLAB Engine for Python stops the function and catches the exception raised by MATLAB.