-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspikehist.m
More file actions
executable file
·27 lines (25 loc) · 1.05 KB
/
spikehist.m
File metadata and controls
executable file
·27 lines (25 loc) · 1.05 KB
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SPIKEHIST() function
%
% Construct spike histogram data given a vector of minima or
% maxima in the signal (see find_min() or find_max() function)
% Voltage range is binned into 200 bins.
% To plot the histogram at command line use:
%
% bar(vo, S);
%_______________________________________________________________
% Arguments:
% H = vector of minima or maxima in the signal.
% (see find_min() or find_max() function)
%_______________________________________________________________
% Returns:
% S = vector of count values (y-axis)
% vo = vector of voltage values (x-axis)
%_______________________________________________________________
% (c) 2003 Witold J. Lipski. Please feel free to copy
% and/or modify this code. Questions/Comments: wjl3@pitt.edu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [S, vo] = spikehist(H)
spikeindex = find(H~=0);
spikes = H(spikeindex);
[S, vo] = hist(spikes, 200);