Reputation: 515
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 takes a long time and requires me manually to close Matlab, is there any way to restart Matlab without leaving the interpreter? like in Python we can restart the Kernel without closing Spyder...
Upvotes: 1
Views: 870
Reputation: 1121
Per the documentation, you follow these steps to update a python module.
% Unload module
clear classes
% Import new module
mod = py.importlib.import_module('myPyFilename');
% Reload module (Python 2.7)
py.reload(mod);
% Reload module (Python 3.X)
py.importlib.reload(mod);
Upvotes: 4