View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

Be the first to rate this file! 12 Downloads (last 30 days) File Size: 287 KB File ID: #39663 Version: 1.7
image thumbnail




28 Dec 2012 (Updated )

Spike sorting program for extracellular recordings. Version 1.4

| Watch this File

File Information

GUI program that runs in Matlab and allows the user to draw polygons or boxes around multidimensional data points. This 'clustering' of data is used often for multi-electrode recordings of neural data. The program has been tested on Windows, Linux, and Mac platforms.

-Manual 2D clustering with polygons
-Interface for custom semi-automated sorting code
-3D rotation of feature space
-Filtering of points to precisely define each polygon’s scope
-Easy to use interface (context menus, undo states, zooming and panning)

Requires a mex compiler (free) for setup. If you don't have one, see here for easy instructions:

Also, please view readme.txt for setup instructions


Decimate Polygon inspired this file.

MATLAB release MATLAB 6.5 (R13)
Other requirements Mex compiler (
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
07 Oct 2016 naig Chenais

Hello, I do have the same problem than Laurens when starting matclust. When I ran matclustset I have the following error :

Error using save
Unable to write file matclust_defaults: permission denied.

Error in matclustsetup (line 17)
save matclust_defaults matclust_defaults;

Comment only
29 Sep 2013 Laurens Witter

Hi Mattias, Thank you for the quick response. The first time I tried to compile it all seemed to work: No errors (but also no output, which I didn't realise should be there).
I finally solved the problem today. My SDK 7.1 had some problems and I had to deinstall and install some things. Anyway, MatClust is running. Thanks!

Comment only
27 Sep 2013 Mattias Karlsson

Hi Laurens. This error happens if the c function were not compiled during install, or if they were not put in the matclust main directory. When you type 'matclustsetup', you should be in the matclust directory so that the compiles files are placed there. What was the output on the screen when you ran matclustsetup?

Comment only
27 Sep 2013 Laurens Witter

I am looking for a nice clustercutting program and would like to use your submission. Install works fine, but when starting I get and error:

>> matclust
loading.There was a problem starting matclust. Error in figure1_fill.
Undefined function 'fastbitset' for input arguments of type 'int32'.

Comment only
14 Jan 2013 Rob Campbell

Rob Campbell (view profile)

Nice, thanks!

Comment only
04 Jan 2013 Mattias Karlsson

Hi John, matclust takes a matlab matrix as input, where each column is a spike feature and each row is one spike. Check out the readme.txt file for all input options. You'll need to convert the .ntt file into such a matrix before you can start. Luckily, neuralynx provides a function to import .ntt files to matlab (Nlx2MatSpike.m). It can be downloaded here:

Then, you'll need to compute which features you want to use. The easiest feature to pull out is the peak amplitude of each spike. For tetrodes, you would want an n by 5 matrix, where the first column is time (in seconds), and the next four columns are the peak amplitudes of each spike.

Comment only
03 Jan 2013 John Thompson

Can your function handle Neurlynx (.ntt) data files?

Comment only
24 Jan 2013 1.1

Version 1.4
Added 'magic wand' tool
Minor bug fixes

24 Jan 2013 1.2

Magic wand tool
Scroll wheel zooming
Minor bug fixes

28 Jan 2013 1.4

-Included 'Decimate polygon' code to reduce complexity of magic wand output
-improved keyboard shortcuts
-improved polygon copy-paste

01 Feb 2013 1.5

More copy-paste features/bug fixes

05 Jun 2013 1.7

Removed the object focus reset when cursor moves over cluster screen.

Contact us