% Estimate the ISI CV of a spike train P % dt is the binsize of the representation in P. % cv=CV(P,dt); function ccvv=CV(P,dt); % Get a representation of P as % a vector of spike times s=find(P); % Initialize the vector that will % contains the ISIs. % Note that there is one less ISI % than there are spikes. isis=zeros(1,numel(s)-1); % Fill the isi vector with the ISIs for i=1:numel(s)-1 isis(i)=s(i+1)-s(i); end % Now change to the correct dimensions isis=isis*dt; % The CV is the stdev divided by the mean ccvv=std(isis)/mean(isis);