Histogram fraction of total observations and fraction per unit width
조회 수: 22 (최근 30일)
이전 댓글 표시
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
답변 (1개)
KSSV
2022년 1월 19일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!