Normalize a histogram modification

1 Ansicht (letzte 30 Tage)
Gaëtan Poirier
Gaëtan Poirier am 2 Okt. 2017
Bearbeitet: Jan am 2 Okt. 2017
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 Kommentar
Jan
Jan am 2 Okt. 2017
Bearbeitet: Jan am 2 Okt. 2017
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by