File Exchange

image thumbnail

Rasterplot

version 1.0.0.0 (1.84 KB) by Rajiv Narayan
Plotting Routine to display neural spike trains

22 Downloads

Updated 16 Feb 2006

View License

RASTERPLOT.M Display spike rasters.
RASTERPLOT(T,N,L) Plots the rasters of spiketimes (T in samples) for N trials, each of length L samples, Sampling rate = 1kHz. Spiketimes are hashed by the trial length.

RASTERPLOT(T,N,L,H) Plots the rasters in the axis handle H

RASTERPLOT(T,N,L,H,FS) Plots the rasters in the axis handle H. Uses sampling rate of FS (Hz)

Example:
t=[10 250 9000 1300,1600,2405,2900];
rasterplot(t,3,1000)

Cite As

Rajiv Narayan (2021). Rasterplot (https://www.mathworks.com/matlabcentral/fileexchange/10000-rasterplot), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Alex Sonneborn

Michael Alasoadura

CHUJUN ZHANG

Wonderful code!
Simple to read & give commend, powerful in use.
No need to load datafiles so quite great compatibility.

Federico Claudi

Hi,

does this work if I have trials of varying length?

Cheers

Marco Buiatti

I agree very useful thanks.

Tilman Kispersky

very useful

Rajiv Narayan

Addendum:

Another common method of storing spike data is in matrix form, with ones denoting spikes and zeros denoting no spikes. Its easy to use to this format in rasterplot.

Example:
m=(rand(1000,10)>0.9);
rasterplot(find(m),10,1000)

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!