engSetVisible when starting Matlab Engine from Python
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, when starting Matlab Engine from C++ it was possible to have the engine window visible, and keep it open even after the code was finished, so easy debugging of the workspace content of the engine session was possible. When starting the matlab engine from python, the engSetVisible command does not work and a startup option ("-visible") is not understood. Is there a solution to this? I am aware that a possible workaround is to save the workspace at the end of the script and then reload it. Just this is less convenient than having the workspace open and accessible straight away. Thanks a lot
0 Commenti
Risposta accettata
Robert Snoeberger
il 31 Mag 2015
According to the documentation, you can start matlab with the "-desktop" startup option. See the "Start Engine with Startup Options" subsection of the documentation for more information.
Please note that startup options were added in R2015a. See "MATLAB Engine for Python: Support for startup options" in the R2015a release notes .
4 Commenti
Bo Li
il 1 Giu 2015
Assume the M file "foo.m" is located in folder "C:\tmp", this is one approach that I would try:
>>>eng=matlab.engine.start_matlab("-desktop")
>>>eng.cd(r'C:\tmp') #change to the folder with file "foo.m"
>>>eng.eval("dbstop in foo.m at 2", nargout=0) #set breakpoint
>>>eng.foo() #call the M function, which will pause at line 2
After that, you can check the variables in the workspace of MATLAB.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!