Histogram fraction of total observations and fraction per unit width
22 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Risposte (1)
KSSV
il 19 Gen 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 Commenti
Vedere anche
Categorie
Scopri di più su Histograms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!