MATLAB: Histogram of a m-by-n matrix

histogrammatrix

I have a m-by-n matrix of values between 10^-20 and 10^-8 I drew it by
hist(My_mat(:),15);
I obtain only one big bin of the hist, instead I would like to get several of bins between min and max values. Is it correct my code above ? Do you have any suggestions?

Best Answer

I would do one of two approaches, depending on what your data distribution is:
  1. Increase the number of bins, perhaps from 25 to 100 depending on what you want to do;
  2. Take log10(X) and use that instead.
The first is probably the easiest. Experiment until you get the result you want.