フィルターのクリア

How to restart matlab kernel without closing Matlab

32 ビュー (過去 30 日間)
Jeniffer Viegas
Jeniffer Viegas 2020 年 7 月 21 日
回答済み: Gouri Chennuru 2020 年 8 月 14 日
Hello,
I'm running a Python function in Matlab, and when I make some modifications in the Python function in Python, and then run in Matlab,
Matlab doesn't make the modifications, still running the function as it was before, even if that function doesn't exist anymore, I only overcome that closing Matlab
and restart again, but this take long time and requires me manualy to close Matlab, is there anyway to restart Matlab without leaving the interpreter? like in python we can
restart the Kernel without closing Spyder...

回答 (1 件)

Gouri Chennuru
Gouri Chennuru 2020 年 8 月 14 日
Hi,
You can reload the Modified User-Defined Python Module using reload function.
The Python calling syntax, to reload the module depends on your Python version.
In order to reload Module in Python Version 2.7 execute the command,
py.reload(mod);
and to reload module in Python Versions 3.x Execute the command,
py.importlib.reload(mod);
To know your Python version, you can use the MATLAB pyenv function.
Hope this Helps!

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by