Installation
Quick install
If you want the quickest installation option, and you have git available, run the following snippet in MATLAB. This clones into your current working directory, adds MatNWB to the path, and optionally persists the change:
!git clone https://github.com/NeurodataWithoutBorders/matnwb.git
addpath("matnwb")
% Optional: persist for future MATLAB sessions
savepath()
If you do not have git, prefer a stable release, or run into installation issues, please refer to the detailed guide below.
Prerequisites
MATLAB R2019b or newer (we strive to support MATLAB releases from the past ~5 years).
Note
Dynamically loaded filters for dataset compression are supported only in MATLAB R2022a or later.
Choose an installation method
Pick the method that best fits your workflow:
Method A: Clone from GitHub (development version) — Recommended
Method B: MATLAB Add-On Manager
Method C: Download a release ZIP (offline-friendly, stable)
Method A — Install the development version from GitHub (recommended)
Note
Requires git.
Use this if you want the latest changes or plan to contribute. This clones MatNWB into your current working directory.
From a shell/Terminal:
git clone https://github.com/NeurodataWithoutBorders/matnwb.git
Or directly from within MATLAB:
!git clone https://github.com/NeurodataWithoutBorders/matnwb.git addpath("matnwb") % Optional: persist for future MATLAB sessions savepath()
Method B — Install via MATLAB Add-On Manager
In MATLAB, go to: Home tab → Add-Ons → Get Add-Ons.
In Add-On Explorer, search for
matnwb.Select “NeurodataWithoutBorders/matnwb”, then click “Add to MATLAB”.
Tip
If your organization blocks Add-On Explorer, use Method A or C instead.
Method C — Install from a release ZIP (offline-friendly, stable)
Download the latest release ZIP from the GitHub Releases page.
Unzip into a permanent folder (e.g.,
C:\tools\matnwbon Windows or~/tools/matnwbon macOS/Linux).Add MatNWB to your MATLAB path:
addpath("path/to/matnwb")
(Optional) Persist the change for future sessions:
savepath() % May require write permissions to pathdef.m
Verify your installation
Run this quick check in MATLAB to verify that MatNWB is installed:
versionInfo = ver("matnwb")
You should see a structure with MatNWB version information.
Update or uninstall
Update (Add-On Manager):
MATLAB R2025a and later:
Home → Add-Ons → Manage Add-Ons → Find “matnwb” → Update (if available).
Before MATLAB R2025a:
Uninstall your current version and reinstall a newer version.
Update (Git):
cd path/to/matnwb !git pull
Uninstall (Remove the MatNWB folder from the MATLAB path and delete it):
rmpath("path/to/matnwb") savepath() rmdir("path/to/matnwb", "s") % delete folder and contents
Troubleshooting
MATLAB cannot find MatNWB functions
Ensure the MatNWB folder is on the path (see Verify your installation).
If needed, restart MATLAB after calling
savepath().Use
which nwbRead -allto diagnose duplicate or shadowed installs.
Add-On Explorer blocked by network policy
Use Method A (Git clone) or Method C (release ZIP).
Path persistence issues
savepathmay require write permissions topathdef.m.Run MATLAB as an administrator (Windows) or adjust permissions/create a user pathdef.
Next steps
Read data with
nwbRead()(see Reading NWB Files).Review important data dimension notes: Dimension Ordering in MatNWB.
Explore tutorials: General Tutorials.