Normalize a histogram modification

1 次查看(过去 30 天)
Gaëtan Poirier
Gaëtan Poirier 2017-10-2
编辑: Jan 2017-10-2
What do I need to put in to normalize the distribution?
function y = mkhist(lambda, n_mea, n_smpls_per_mea)
%program to fix up histogram (normalization, etc) and
%prepare plots with both histogram and the analytical PDF
%called AFTER a call to 'run'
global xacc hist bin_range bin_size n_bins midpt x exact_pdf
% normalize histogram (histnorm_inv is INVERSE of normalization):
histnorm_inv = 1.
% ^^^^^^^^ <-- MODIFY -- fill in correct form
hist = hist.*histnorm_inv
% Calculate the exact distribution for comparison
x=0:bin_size:bin_range+bin_size
exact_pdf = exp(-x/lambda)/lambda
end
  1 个评论
Jan
Jan 2017-10-2
编辑:Jan 2017-10-2
This is the 3rd thread concerning the same problem. This starts to be confusing. Usually the readers in the forum tends to ignore confusing threads, so better concentrate on one thread and answer the question for clarifications. This is easier for the readers and increases your chance to get an answer.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by