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 CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by