forked from abhranildas/neural-circuit-inference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIBIHistogram.m
More file actions
31 lines (29 loc) · 880 Bytes
/
IBIHistogram.m
File metadata and controls
31 lines (29 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%N*size(binnedspikes,1)*dt*1000/sum(binnedspikes(:))
IBIlist=[];
meanIBIlist=zeros(1,N);
for col=2:N
IBIs=diff(find(binnedspikes(:,col)));
IBIlist=cat(1, IBIlist, IBIs);
meanIBIlist(col)= mean(IBIs);
end
%Measure intervals in ms:
IBIlist=IBIlist*dt*1000;
meanIBIlist=meanIBIlist*dt;
figure(1);
subplot(2,1,1);
plot(meanIBIlist.^-1,'-o');
xlabel('Neurons');
ylabel('Mean spiking Frequency (Hz)');
xlim([2 N]);
title('Mean Spiking Frequencies');
subplot(2,1,2);
hist(IBIlist,10000);
xlabel('Interspike interval (ms)');
ylabel('Frequency');
title(sprintf('Interspike interval histogram (over all neurons)\n%d spikes, Min: %.1fms, Max: %.1fms, Mean: %.2fms', [nnz(binnedspikes),min(IBIlist),max(IBIlist),mean(IBIlist)]));
% subplot(3,1,3);
% meanIBIlist(isnan(meanIBIlist))=[];
% [acor,lag]=cxcorr(meanIBIlist);
% plot(lag,acor);
% autoc=acor(61);
clear IBIs IBIlist col