I have a matrix m
and plot a histogram of the third column. I search for the peak in the first 100 bins and get the frequency as a
and the index of the bin as b
. Now I need the edges of the bin with index b
. How can I get them?
nbins = 1000;
histo = histogram(m(:,3),nbins,'Orientation','horizontal');
[a,b] = max(histo.Values(1:100))
I can think of two easy ways to do this:
If you need an explanation for the "tricks" - please say so.