Gaussian Distribution
168 ビュー (過去 30 日間)
古いコメントを表示
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
2020 年 7 月 14 日
Here's a gaussian function where you can set the mean, standard deviation, amplitude, and vertical offset.
採用された回答
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 件のコメント
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 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!