Open eliselavy opened 2 years ago
Test of the MATLAB Integration for Jupyter has been made: Project here : https://github.com/mathworks/jupyter-matlab-proxy =>Enables you to access MATLAB in a web browser from your Jupyter environment. This package currently, does not provide a kernel level integration with Jupyter. (under active development)
⚠️ have the appropriate licence to run the MATLAB Integration for Jupyter
For Mac user:
9-1e368a51acdf.png)
Set bash_profile:
# Setting PATH forMatlab
# The original version is saved in .bash_profile.pysave
PATH="/Applications/MATLAB_R2022b.app/bin/:${PATH}"
export PATH
This package currently, does not provide a kernel level integration with Jupyter. (under active development)
TO TEST also: MATLAB Integration for Jupyter in a Docker Container https://github.com/mathworks-ref-arch/matlab-integration-for-jupyter/tree/main/matlab The Dockerfile in this repository builds a Docker® image based on jupyter/base-notebook which contains the jupyter-matlab-proxy package and installs MATLAB® using the MATLAB Package Manager (mpm).
The resulting Jupyter environment enables you to start MATLAB in a web browser tab from a Jupyter® notebook.
If you want to install the MATLAB Integration for Jupyter without using Docker, use the installation instructions in the repository MATLAB Integration for Jupyter instead.
TESTED ALSO: MATLAB kernel for Jupyter Project here : https://github.com/Calysto/matlab_kernel
Prerequis
https://fr.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
Install Using pip Starting with MATLAB R2022b, you can use the pip command to install the API.
One solution:
cd /Applications/MATLAB_R2022b.app/extern/engines/python
python -m pip install .
Other solution:
python -m pip install matlabengine
For MAC, you need to define the DYLD_LIBRARY_PATH look at here : https://pypi.org/project/matlabengine/=> I choose the first solution
:warning:
OSError: MATLAB Engine for Python supports Python version 2.7, 3.8, 3.9, and 3.10, but your version of Python is 3.7
=> upgrade if you are in same case as me
Install the matlab_kernel
pip install matlab_kernel
Start jupyter notebook
Create notebook with the MATLAB kernel
t = linspace(0,6*pi,100);
plot(sin(t))
grid on
hold on
plot(cos(t), 'r')
Matlab in jupyter notebook
2 solutions tested: