function v = cbar(cin)
%
% c = sort(cin)
%
% Given numbers c = [ c1 ... cN ]
%
% return the N-1 numbers v = [ (c1+c2)/2 (c2+c3)/2 ... (cN-1 + cN)/2 ]
%
c = sort(cin);
N = length(c); N1 = N-1; cs = zeros(1,N);
cs(1:N1) = c(2:N);
cc = (c+cs)/2;
v = cc(1:N1);
