function [vals,idx] = util_quantize( vals,nbin )
minval = min(vals(:));
maxval = max(vals(:));
parts = linspace(minval,maxval,nbin);
knots = (parts(1:end-1)+parts(2:end))/2;
[idx,vals] = quantiz(vals,knots,parts);
idx = idx+1;

end

