Code covered by the BSD License  

Highlights from
Data Browser

image thumbnail
from Data Browser by Phil Larimer
A utility to browse data files that involve one or more channels of data over time.

isiCv(inData)
function cvValue = isiCv(inData)
% calculates the coefficient of variation for the inter-spike interval
%                               standard deviation
% Coefficient_of_Variation =    ------------------
%                                       mean

ISI = diff(inData);

if numel(ISI) > 1
    cvValue = std(ISI(ISI < 2000)) / mean(ISI(ISI < 2000));
else
    cvValue = nan;
end

if nargout == 0
	figure('numberTitle', 'off', 'name', ['ISI CV = ' sprintf('%0.2f', cvValue)])
	hist(ISI)
end

Contact us at files@mathworks.com