Polyglot MATLAB Notebooks
Version 0.0.1 (45 MB) by
Alessandro DAmico
A repository containing examples and instructions on using Script of Script (SoS) Polyglot notebooks with MATLAB and other languages.
Script of Script (SoS)
Polyglot MATLAB Notebooks usingA repository containing examples and instructions on using Script of Script (SoS) Polyglot notebooks with MATLAB and other languages.
Here are the tools I'm using
- OS: Windows 11
- git: 2.37.2.windows.2
- MATLAB: R2022b (9.13.0.2049777 )
- Terminal launching Miniconda3
- Conda: 23.3.1
- Python: 3.10.10
- pip: 23.1.2
Installation Steps
1. Install and activate MATLAB
2. Install miniconda3 or anaconda3 (I use miniconda) and open anaconda terminal
- Note: Run the terminal in administrator or elevated permission (depending on your OS)
3. Create an environment for MATLAB in miniconda and activate
-
conda create -n "sos" python=3.10
-
conda activate sos
4. (In MATLAB console) Point MATLAB to your conda environment
-
pyversion('C:\Users\<user>\miniconda3\envs\matlab\python.exe'); pyenv('ExecutionMode', 'OutOfProcess');
5. Install SoS, Python and MATLAB subkernels and matplotlib (for Python) via
- run in conda terminal:
conda install sos sos-pbs sos-notebook jupyterlab-sos sos-papermill sos-python sos-r matplotlib -c conda-forge
pip install sos-matlab
- Source: https://vatlab.github.io/sos-docs/running.html#Conda-installation
6. Install the MATLAB engine to Python (note that official documentation is deprecated on MathWorks and SoS websites now)
- In conda terminal run:
python -m pip install matlabengine==9.13.7
- To test that this worked, first activate Python in the conda terminal via:
-
python
- Then execute the following code:
import matlab.engine eng = matlab.engine.start_matlab() eng.isprime(37)
- This should return
True
. If there were errors, troubleshoot at https://github.com/mathworks/matlab-engine-for-python
- This should return
- Exit Python with
exit()
but keep terminal open.
matlab_kernel
7. (still in conda terminal) Install -
pip install matlab_kernel
8. Confirm that the installation works by running the example/test_installation notebook and running each cell.
- Open a Jupyter Notebook in conda terminal via:
jupyter notebook
Notes:
- You will need to change the ratelimit for Jupyter to visualize larger EEGLAB objects. Follow the steps here:
- https://stackoverflow.com/questions/43288550/iopub-data-rate-exceeded-in-jupyter-notebook-when-viewing-image
-
jupyter notebook --generate-config
- edit this file
- search for
c.NotebookApp.iopub_data_rate_limit
- uncomment this and set the value to:
=1.0e10
Cite As
Alessandro DAmico (2025). Polyglot MATLAB Notebooks (https://github.com/ollie-d/polyglot-matlab-notebooks/releases/tag/v0.0.1), GitHub. Retrieved .
MATLAB Release Compatibility
Created with
R2022b
Compatible with R2022b to R2023a
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
0.0.1 |
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.