% OVERALLRATE determines the overall firing rate from a spike train
%             
function r = overallrate(sX);

n = length(sX);
T = sX(n) - sX(1);

if n>1 % 'rate' make sense only for more than one spikes
  r = n/T;  
else
  r = 0; 
end