Frequently Asked Question

How can I use MATLAB in a Jupyter notebook?
Last Updated 2 years ago

In order to use MATLAB in a Jupyter notebook, you need to have a shared MATLAB engine running. Here are the steps to follow:

  • Open MATLAB on the remote desktop (Applications menu> Research > MATLAB)
  • Enter the following command to a share engine:
    matlab.engine.shareEngine('MATLABEngine')
  • Open a notebook with MATLAB kernek (Launcher > MATLAB)
  • Sample code to access the engine:
    import matlab.engine

    eng = matlab.engine.connect_matlab('MATLABEngine')

    eng.sqrt(4.0)

Please Wait!

Please wait... it will take a second!