フィルターのクリア

plot gaussian and standard deviation on my histogram

5 ビュー (過去 30 日間)
Fatemeh Shomal Zadeh
Fatemeh Shomal Zadeh 2020 年 9 月 8 日
コメント済み: Star Strider 2020 年 9 月 9 日
Hi everyone,
I have this code and have plotted the histogram and now want to have gaussian and standard deviation.
can anyone help me please?
figure('Name','A3{1}.BMd_Img_o_part1')
edges= linspace(0,255,21);
histogram(image1, 'BinEdges',edges,'normalization','pdf')

採用された回答

Star Strider
Star Strider 2020 年 9 月 8 日
I would use normfit and normpdf, although there are also other options:
image1 = 42*randn(1,1000)+42*3; % Create Data
figure('Name','A3{1}.BMd_Img_o_part1')
edges= linspace(0,255,21);
[muHat,sgHat] = normfit(image1);
pdfplot = normpdf(edges, muHat, sgHat);
figure
histogram(image1, 'BinEdges',edges,'normalization','pdf')
hold on
plot(edges, pdfplot, '-r', 'LineWidth',2)
hold off
.
  14 件のコメント
Fatemeh Shomal Zadeh
Fatemeh Shomal Zadeh 2020 年 9 月 9 日
Thank you so much , I do really appreciate you efforts.
Star Strider
Star Strider 2020 年 9 月 9 日
As always, my pleasure!

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

その他の回答 (1 件)

Fatemeh Shomal Zadeh
Fatemeh Shomal Zadeh 2020 年 9 月 8 日
this is a histogram figure that i have.

カテゴリ

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