function [pdf, centers] = isihist(isis, binwidth) % Compute normalized histogram of interspike intervals. % % Arguments: % isis: vector of interspike intervals in seconds % binwidth: width in seconds to be used for the ISI bins % % Returns: % pdf: vector with pdf of interspike intervals in Hertz % centers: vector with centers of interspikeintervalls in seconds bins = 0.5*binwidth:binwidth:max(isis); % histogram data: [nelements, centers] = hist(isis, bins); % normalization (integral = 1): pdf = nelements / sum(nelements) / binwidth; end