Integrating Jupyter, MATLAB, and Quarto in VS Code

MATLAB
Jupyter
Quarto
VS Code
Published

March 14, 2026

If you like notebooks for exploration but also want clean, publishable technical writing, this stack works very well:

This post shows a practical setup that has worked well for me on Linux with a project-local Python environment managed by uv.

Why this combination works

Jupyter gives you fast iteration. MATLAB gives you mature numerical tooling. Quarto gives you clean publishing and version control friendly source files. In practice, you can prototype in notebook style and publish with almost no copy-paste.

Project-local Python environment with uv

I prefer a local .venv in the site repository so kernels and tools are pinned per project.

cd ~/Desktop/jasonhnicholson.com
uv venv --python 3.12 .venv
source .venv/bin/activate
uv sync

Important note: MATLAB Engine for Python currently supports Python 3.9 through 3.12. If your environment is newer (for example 3.14), MATLAB notebook execution may fail even if the kernel appears in Jupyter.

Install Jupyter + MATLAB integration packages

Inside the same virtual environment:

uv pip install --python .venv/bin/python matlab_kernel matlabengine

On Linux, matlabengine may need MATLAB runtime libraries in LD_LIBRARY_PATH at install time. Example:

MATLABROOT=/home/jason/Programs/MATLAB/2025b \
LD_LIBRARY_PATH="/home/jason/Programs/MATLAB/2025b/bin/glnxa64:${LD_LIBRARY_PATH:-}" \
uv pip install --python .venv/bin/python matlabengine

Then register the MATLAB Jupyter kernel:

.venv/bin/python -m matlab_kernel install --user --replace

Make VS Code pick the right interpreter and kernels

Set your workspace interpreter to the project venv. In .vscode/settings.json:

{
  "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}

Now open a notebook in VS Code and select the Matlab kernel from the kernel picker.

Quick smoke test in a notebook

Create a notebook cell and run:

disp(1+1)

If everything is wired correctly, output should be:

2

Where Quarto fits in

Quarto can render executable documents and notebooks, so your analysis and write-up stay together.

Two common paths:

  1. Write a .qmd article with executable code blocks.
  2. Start from a notebook and publish through Quarto.

A minimal .qmd section with MATLAB code block:

## MATLAB check

::: {#73f18ada .cell execution_count=1}
``` {.matlab .cell-code}
a = 2;
b = 3;
disp(a*b)
```

::: {.cell-output .cell-output-stdout}
```
     6
```
:::
:::

Then render with:

quarto render

Typical workflow

  1. Explore quickly in notebook cells.
  2. Move stable analysis to a .qmd article.
  3. Keep commands and environment setup in the repository for reproducibility.
  4. Publish with Quarto using the same source you used for computation.

Troubleshooting tips

  • Kernel is visible but MATLAB code fails:
    • matlabengine is usually missing from the active venv, or Python version is unsupported.
  • matlabengine build fails on Linux:
    • set MATLABROOT and include ${MATLABROOT}/bin/glnxa64 in LD_LIBRARY_PATH during install.
  • VS Code uses wrong Python:
    • set python.defaultInterpreterPath to project .venv and reload VS Code window.
  • Kernel starts from wrong Python:
    • reinstall kernelspec from the intended venv and replace existing spec.

Closing thoughts

Jupyter + MATLAB + Quarto is a strong setup for technical blogging and engineering documentation. You get interactive computation, reproducible environments, and polished publishing in one workflow, all from VS Code.