Harry Collins Harry Collins - 3 months ago 19
Python Question

Runtime Error: Unknown MATLAB location when using a wrapper in python

I am trying to use a Matlab wrapper for my code in the ipython spyder IDE.
I get the following error when I run the code:

raise RuntimeError("Unknown MATLAB location: try to initialize MatlabSession with matlab_root set properly.")

RuntimeError: Unknown MATLAB location: try to initialize MatlabSession with matlab_root set properly.


I'm hoping this is a simple fix to import a module or change a setting in spyder. Or if anyone knows how to set the matlab_root? Any help would be much appreciated, Thank You!

Answer

Basically matlab_root is a variable inside MatlabSession, that points to the folder where MATLAB is installed. What is happening here is that probably matlab_root has a default value that is not where your MATLAB is installed. you need to change/set this variable to the folder where MATLAB is installed.