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/isis.m
2015-11-26 23:40:12 +01:00

21 lines
588 B
Matlab

function isivec = isis( spikes )
% returns a single list of isis computed from all trials in spikes
%
% isivec = isis( spikes )
%
% Arguments:
% spikes: a cell array of vectors of spike times in seconds
% isivec: a column vector with all the interspike intervalls
%
% Returns:
% isivec: a column vector with all the interspike intervalls
isivec = [];
for k = 1:length(spikes)
difftimes = diff( spikes{k} );
% difftimes(:) ensures a column vector
% regardless of the type of vector in spikes{k}
isivec = [ isivec; difftimes(:) ];
end
end