MATLAB: What if I need both the data and the plot of a histogram

datahisthistogramplot

I have to run twice?
hist(data,number_of_bins); h1 = hist(data,number_of_bins);

Best Answer

Call HISTOGRAM instead of HIST and access the properties of the histogram graphics object it returns.
Related Question