the sum of the two gaussian distributions

7 ビュー (過去 30 日間)
fang-chu
fang-chu 2013 年 7 月 26 日
ratio1 = 25;
ratio2 = ratio1/4;
mu1 = 7.5;
FWHM1 = 60;
sigma1 = FWHM1/(2*sqrt(2*log(2)));
w1 = -100:100;
p1 = -.5 * ((w1 - mu1)/sigma1) .^ 2;
p2 = (sigma1 * sqrt(2*pi));
gauss1 = ratio1*exp(p1) ./ p2;
mu2 = -7.5;
FWHM2 = 55;
sigma2 = FWHM2/(2*sqrt(2*log(2)));
w2 = -100:100;
p3 = -.5 * ((w2 - mu2)/sigma2) .^ 2;
p4 = (sigma2 * sqrt(2*pi));
gauss2 = ratio2*exp(p3) ./ p4;
hold all
plot(w1,gauss1);
hold all
plot(w2,gauss2);
hold all
grid on
How can I sum two distribution to obtain a plot representing the sum of two gaussian distributions?

採用された回答

the cyclist
the cyclist 2013 年 7 月 26 日
編集済み: the cyclist 2013 年 7 月 26 日
If you literally want the sum (as opposed to some kind of joint probability), you can just add the two:
plot(w1,gauss1+gauss2,'r')
You can do that here because you calculated gauss1 and gauss2 over the same range.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by