function w=makemat_hist(y,n)
[d_1,n_M] = max(y);
[d_2,n_m] = min(y);
y = abs(y);
L = length(y);
M = max(y);

xbnd = M/n * ((0:n));
xbnd(end) = inf;

s = floor(linspace(0,L,n+1));

for k = 1:n
    x = y(s(k)+1:s(k+1));
    w(:,k) = histc(x, xbnd);
end

w = w/L*n*100;
