This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/pointprocesses/code/spikeraster.m
2014-11-12 18:39:02 +01:00

18 lines
417 B
Matlab

function spikeraster( spikes )
% Display a spike raster of the spike times given in spikes.
% spikes: a cell array of vectors of spike times
ntrials = length(spikes);
for k = 1:ntrials
times = 1000.0*spikes{k}; % conversion to ms
for i = 1:length( times )
line([times(i) times(i)],[k-0.4 k+0.4], 'Color', 'k' );
end
end
xlabel( 'Time [ms]' );
ylabel( 'Trials');
ylim( [ 0.3 ntrials+0.7 ] )
end