change histogram graph to smooth curve

3 ビュー (過去 30 日間)
hamza
hamza 2014 年 5 月 15 日
コメント済み: hamza 2014 年 5 月 15 日
I have this code to sum 10 independent uniform random variables to verify the central limit theorem but I could not change the code to get a curve plot instead of the histogram this is the code
uniform_RVs = [];
sample_averages = [];
random_draw = [];
for i = 1:500
for j = 0:20
random_draw = [random_draw 4.*rand];
end
sample_averages = [sample_averages mean(random_draw)];
uniform_RVs = [uniform_RVs random_draw];
random_draw = [];
end
figure(1)
hist(uniform_RVs, 25)
xlabel('Observation')
ylabel('Frequency')
figure(2)
hist(sample_averages, 25)
xlabel('Observation')
ylabel('Frequency')
sample_mean = mean(sample_averages)
sample_var = var(sample_averages)
Please help me

採用された回答

Dishant Arora
Dishant Arora 2014 年 5 月 15 日
histfit fits normally distributed data. For details refer documentation.
doc histfit
  1 件のコメント
hamza
hamza 2014 年 5 月 15 日
thank you

サインインしてコメントする。

その他の回答 (1 件)

hamza
hamza 2014 年 5 月 15 日
but I do not know which command to use

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by