function  [a,b] = binvector(x)

x = round(x);
minvalue = min(x)
maxvalue = max(x)
bins = minvalue:1:maxvalue;
values = zeros(size(bins));

for i=1:length(x)
    j = x(i)-minvalue+1;
    values(j) = values(j)+1;
end

b = values;
a = bins;