function plotcounthist(spikes, w) % Plot histogram of spike counts. % % Arguments: % spikes: a cell array of vectors of spike times in seconds % w: duration of window in seconds for computing the counts n = counts(spikes, w); maxn = max(n); [counts, bins] = hist(n, 0:1:maxn+10); counts = counts / sum(counts); bar(bins, counts); xlabel('counts k'); ylabel('P(k)'); end