How to get the bin elements in histogram plots
Afficher commentaires plus anciens
Hello there,
I am new to Matlab and i using hist/bar functions for a while now. I have a droplet diameter data (8000x1) and i am able to generate histograms of the distribution with any number of bins.
However, I would like to extract the data used in each bin for another plot. I appreciate any inputs how to extract the data in each bin?
Thanks Kumaran
Réponses (1)
Fangjun Jiang
le 5 Déc 2011
2 votes
[N,BIN] = HISTC(X,EDGES,...) also returns an index matrix BIN. If X is a vector, N(K) = SUM(BIN==K). BIN is zero for out of range values. If X is an m-by-n matrix, then, for j=1:n, N(K,j) = SUM(BIN(:,j)==K); end
Catégories
En savoir plus sur Histograms dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!