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

19 lines
516 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
%
% 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