Home > Net >  How to run a Matlab R2018b script in Spyder (python 3.10) from Anaconda3?
How to run a Matlab R2018b script in Spyder (python 3.10) from Anaconda3?

Time:08-24

I tried run my *.m script (written by Matlab R2018b) from spyder (anaconda3 & python version 3.10 on windows 10). I got compatibility problem of python & Matlab. I installed trial Matlab R2022a but it didn't solve my problem. I also reduced the python version from 3.10 to 3.6 to be compatible with Matlab R2018b, as I saw in some advices in stack overflow. However, this version reduction took too much time on my laptop and didn't solve the problem. I am using Computer Vision, Image Processing, Optimization, and Statistics & Machine Learning tools boxes of Matlab R2022a (trial version) or R2018b. Many thanks for your helpful comments.

Best regards,

CodePudding user response:

This is a good idea, The python code looks like:

import matlab.engine
eng = matlab.engine.start_matlab()
eng.simple_script(nargout=0)
eng.quit()

And another way:

it works in anaconda spyder but u gave to install anaconda 3.4 or below for Matlab 2016b or according to the python package present in Matlab. you can check the python package available in Matlab from matlabroot\extern\engines\python path for safe side install anaconda 2.7 or 3.0 and

goto> anaconda prompt and type

cd "matlabroot\extern\engines\python"

python setup.py install

CodePudding user response:

Python has an initial configuration so that the system recognizes it, and we can call it.

Did you set the Python 3.6 environment in the setting?

  • Related