Histogram fraction of total observations and fraction per unit width
22 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm working on a HW problem and I am kind of stuck. I took a class in Matlab several semesters ago and am now in a class where our HW is exclusivly done in Matlab. I've been given a data set where I have to use that data to create a series of histograms. The first histogram is the number of observations over the measuered data, no problem. The second and third histograms ask that I take the given data and display the fraction of total observations over each interval, and display the fraction per unit width over each interval. Is there an easy way to go about doing this or am i going to have to resort to doing the math and creating my graphs?
1 commentaire
Réponses (1)
KSSV
le 19 Jan 2022
You can get the wanted information from histogram.
Example:
x = randn(1,100) ; % random data for demo
h = histogram(x)
% fraction of total observations over each interval
h.Values/length(x)
3 commentaires
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!