Home Running MATLAB files/functions in Python (Windows & Anaconda)
Post
Cancel

Running MATLAB files/functions in Python (Windows & Anaconda)

Install

  1. Make sure Matlab is installed on your computer
  2. Open anaconda prompt as an administrator
  3. Activate the environment you want to use Matlab in
    1
    
    conda activate insert-name-of-environment-here
    
  4. find the matlab directory
    1
    
    matlab -batch matlabroot
    

https://www.scivision.dev/matlab-engine-python-install/

  1. cd to that directory
    • in my case I did:
      1
      2
      
      cd C:\Users\Matth>
      cd C:\Program Files\MATLAB\R2021a
      
  2. Run the install script
    1
    2
    
    cd extern/engines/python
    python setup.py install
    
  3. Test to see if it works by opening a Jupyter notebook or Spyder file and run
    1
    
    import matlab.engine
    
    • if no errors, you’re good to go.
This post is licensed under CC BY 4.0 by the author.

How to properly install CUDA on Ubuntu Linux (NVCC)

Getting started with Python (Draft)