MATLAB Answers

Calling python while program execution in matlab

조회 수: 9(최근 30일)
Sajjad Asefi
Sajjad Asefi 22 Jan 2021
편집: Sajjad Asefi 22 Jan 2021
Hi there,
I would like to run my matlab code (assume in a for loop), and during each iteration of that loop call a python code and again come back to matlab.
Is such a thing possible?
P.S. consider the following simple example
for k = 1 : 7
% send "k" to python and pause matlab code
% execute python code (for example the code sends back weekday from python to matlab) and continue the code
Please provide a simple example (wether from python side to connect with matlab or wise versa).

  댓글 수: 0

댓글을 달려면 로그인하십시오.


ES 22 Jan 2021
Please try Python Engine for MATLAB.
What you intend is fully achievable.

  댓글 수: 1

Sajjad Asefi
Sajjad Asefi 22 Jan 2021
Thanks for the answer, but do you have any idea how shall I pause, and after python code execution, continue it?! I mean can you please provide a simple example

댓글을 달려면 로그인하십시오.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by