function hc = my_histcounts(f, B)
%function hc = my_histcounts(f, B);
%histogram counts
%input: image or array f, bin centers B. B: vector
%output: histogram counts

L = length(B);
hc = 0*B; %initialize histcounts

for i = 1:L
    hc(i) = sum(sum(sum(f == B(i))));
    % count # of times f == bin center B(i)
    % and store in hc
end

end

