Histogram fraction of total observations and fraction per unit width
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Mohan
el 5 de Feb. de 2024
Please refer to this answer, which will give you the fraction in histogram
Respuestas (1)
KSSV
el 19 de En. de 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 comentarios
Ver también
Categorías
Más información sobre Histograms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!