Python support in Matlab Function Block
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to call a python function from a Matlab Function Block within Simulink. When I try this, I get an "Undefined function or variable 'py.[funcion name]'. This occurs for all python functions, even native ones like 'int'. I can call pyversion from the Matlab Function block and it returns the correct python installation information. These python functions work as exected when I call them from the Matlab Command Window or from a script invoked from the command window, just not in my Matlab Function Block. Is there something special I need to do in order to get Simulink to recognize 'py.*'? I am using Matlab 2018b.
-Thanks for your help.
1 commentaire
Réponses (1)
Shivam Sardana
le 30 Mai 2019
There is a similar question which may be of relevance to you: https://www.mathworks.com/matlabcentral/answers/359575-how-to-run-a-python-code-on-simulink
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!