Gaussian Distribution

조회 수: 163 (최근 30일)
KB
KB 2012년 2월 17일
답변: Sivylla Paraskevopoulou 2024년 12월 28일
Hi All, I am trying to plot a amplitude Gaussian distribution in Matlab. I have only amplitude peak, mean and sigma (sd) values. The peak is corresponding to the mean. How to get a Gaussian normal plot using only that three values? What could be the code for that?
  댓글 수: 1
Adam Danz
Adam Danz 2020년 7월 14일
Here's a gaussian function where you can set the mean, standard deviation, amplitude, and vertical offset.

댓글을 달려면 로그인하십시오.

채택된 답변

Honglei Chen
Honglei Chen 2012년 2월 17일
This is really just plotting an equation, for practical purpose, you can plot from -4*sd to 4*sd. Let's say mu is the mean,
x = linspace(-4*sd,4*sd,1000);
y = 1/(2*pi*sd)*exp(-(x-mu).^2/(2*sd^2));
plot(x,y);
  댓글 수: 3
Kunal Lakhani
Kunal Lakhani 2016년 10월 20일
Clarification of the formula of gaussian distribution.
Adam Danz
Adam Danz 2021년 5월 1일
@Mohammed Ghouse Mohiuddin, in response to your flag > The code is incorrect, you just have to define mu and sd.
mu = 10;
sd = 4;
x = linspace(-4*sd,4*sd,1000);
y = 1/(2*pi*sd)*exp(-(x-mu).^2/(2*sd^2));
plot(x,y);

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sivylla Paraskevopoulou
Sivylla Paraskevopoulou 2024년 12월 28일
To learn more about normal or Gaussian distribution, read the topic Normal Distribution.

Community Treasure Hunt

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

Start Hunting!

Translated by