Is there a way to find the 'mode' of a histogram?
32 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I generated a histogram (hist3) using two variables, is there a way to find the 'mode' from this histogram?
Thanks !
3 Kommentare
dpb
am 9 Jul. 2013
If have Curve Fitting Toolbox,
doc fit
If not you can fit a polynomial model in x and y by generating the coefficient matrix and using \ to solve. You can then solve that for a maximum either analytically or numerically.
Alternatively, you could use interp2 and interpolate on a finer mesh to approximate the maximum.
Similar to that would be the approach outlined earlier of just using the counts from hist3. More bins would produce closer estimates as long as the number of points is large enough per bin to avoid the noise.
Antworten (1)
dpb
am 8 Jul. 2013
Bearbeitet: Image Analyst
am 8 Jul. 2013
Seems to me would be approximated as
[n,c]=hist3(....;
[mx,ix]=max(n); % magnitude of most frequent bin
location would the the ix-th entry in the c cell-array of bin center values
--
0 Kommentare
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!