normalize a histogram in matlab 2013b
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sajid Afaque
le 12 Juin 2020
Réponse apportée : Walter Roberson
le 12 Juin 2020
hello all ,
i have a similar issue as in https://www.mathworks.com/matlabcentral/answers/266306-how-to-normalize-a-histogram#answer_208254
i need the same that is my y axis should be in probability and my x-axis should remain same (not the number of bins).
since their is no direct normalization function in 2013b version i am using
h = hist(z);
h =h/sum(h);
bar(h);
using bar(h) i get my y axis in probabilities,but my x-axis limits to number of bins. i need the x-asix range same as the one i get when i do hist(z).
in advance ,thanks for the help
0 commentaires
Réponse acceptée
Walter Roberson
le 12 Juin 2020
[h, x_centers] = hist(z);
h = h/sum(h);
bar(x_centers, h);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Histograms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!