La traduction de cette page n'est pas à jour. Cliquez ici pour voir la dernière version en anglais.
Intégrer du code Python à Simulink
Simulink permet d'implémenter des algorithmes conçus en code Python. Vous pouvez implémenter des modules Python à Simulink avec le bloc MATLAB Function, le bloc MATLAB System ou Python Importer. Pour implémenter des algorithmes simples, utilisez le bloc MATLAB Function. Pour les algorithmes nécessitant le traitement d'états dynamiques, de données en streaming et la personnalisation de blocs supplémentaires, utilisez le bloc MATLAB System. Python Importer permet d'importer des modules Python dans Simulink en générant des blocs personnalisés pour les fonctions spécifiées.
Pour plus d'informations sur l'utilisation de Python dans MATLAB®, voir Appeler Python à partir de MATLAB.
Blocs
Python Code | Integrate native Python code into a Simulink model (depuis R2025a) |
Rubriques
- Overview of Integrating Python Code with Simulink
Integrate Python code with Simulink Using MATLAB Function block or MATLAB System block.
- Integrate Python Code into Simulink Using Python Code Block
Integrate native Python code, define interfaces and block algorithm, and run simulations in Simulink.
- Import Python Code to Simulink Using Python Importer Wizard
Use the Python Importer to Import Python Modules and Packages to Simulink.