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/exercises/spikecountshists.m

23 lines
565 B
Matlab

w = 0.1;
bins = 0:1:10;
spikecounts{1} = counts(poissonspikes, w);
spikecounts{2} = counts(pifouspikes, w);
spikecounts{3} = counts(lifadaptspikes, w);
titles = {'Poisson', 'PIF OU', 'LIF adapt'};
for k = 1:3
subplot(1, 3, k);
[h, b] = hist(spikecounts{k}, bins);
bar(b, h/sum(h));
mu = mean(spikecounts{k});
ppois = poisspdf(bins, mu);
hold on;
scatter(bins, ppois, 'filled');
hold off;
title(titles{k})
xlabel('Spike count');
xlim([-0.5, 8.5]);
ylim([0.0 0.8]);
end
savefigpdf(gcf, 'spikecountshists.pdf', 20, 7);