This repository has been archived on 2021-05-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2017-01-22 15:31:40 +01:00

12 lines
325 B
Matlab

function [counts, cbins] = counthist(spikes, tmin, tmax, T, cmax)
tbins = tmin+T/2:T:tmax;
cbins = 0.5:cmax;
counts = zeros(1, length(cbins));
for k = 1:length(spikes)
times = spikes{k};
n = hist(times((times>=tmin)&(times<=tmax)), tbins);
counts = counts + hist(n, cbins);
end
counts = counts / sum(counts);
end