How do I show relative frequency on histogram?
23 次查看(过去 30 天)
显示 更早的评论
Okay, I am supposed to make 1000 random values between 1 to 10 and plot them on the histogram to show the relative frequency.
Also my nbins must be 50
I have..
data=rand(10.*rand(1000,1)+1) hist(data,50)
It puts data on the histogram, but how do I show the relative frequency?
0 个评论
采纳的回答
Star Strider
2014-9-8
The relative frequency is the absolute frequency normalised by the total number of events. In your particular situation, you would get the relative frequency for each bin by dividing the empirical frequencies in each of your bins by 1000.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!