counting total no of particles in a bin in histogram
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sumera Yamin
am 23 Aug. 2019
Kommentiert: dpb
am 23 Aug. 2019
Hi, i have a basic problem. I had made a histogram with nbins = 100.
I want to count the number of particles of that which is maximum number of particles and display it.
what should be the best way to do it.
Thank you very much. Any help is highly appreciated.
3 Kommentare
Akzeptierte Antwort
Saurabh Kelkar
am 23 Aug. 2019
k = hist(x,n);
gives the counts in each of the bins.
modalBin = find(k==max(k) % Gets the bin number of highest bin. Will return two bins if clashes
Alternatively i would recommend using ecdf funtion for doing this.
5 Kommentare
Ted Shultz
am 23 Aug. 2019
It looks like hist is discouraged by mathworks...
dpb
am 23 Aug. 2019
Indeed, but there are some real advantages with them with respect to the new versions...the binning difference above being one and the ease in setting bins for certain specific uses. "Not everything new is necessarily improved."
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Distribution Plots 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!