Once upon a time I had to make my own versions of histogram equalization because at that time that function in the image processing toolbox worked with the assumption that the images were in 8-bit, and the result of using it with double-arrays or 16-bit images were underwhelming. It is not exactly clear to me what type of normalization you want so the 2 functions attached are my histogram equalization and histogram-matching functions, perhaps they can be of use.
HTH