Hi
So, lets say I get 10000 random numbers:
-5000 from normal distribution with mean = 1 and sigma = 1
-5000 from normal distribution with mean = 4 and sigma = 1
Now I have to plot density function.
I know how to plot single density function, not a mix.
Can you help me?
Thanks,
Lukas

댓글 수: 1

Torsten
Torsten 2020년 4월 5일
h = histogram(data,'Normalization','probability')

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

 채택된 답변

Jeff Miller
Jeff Miller 2020년 4월 6일

0 개 추천

x=-6:.01:10;
pdf1 = normpdf(x,1,1);
pdf2 = normpdf(x,4,1);
mixpdf = 0.5*pdf1 + 0.5*pdf2;
figure;
plot(x,mixpdf);

추가 답변 (0개)

질문:

2020년 4월 5일

댓글:

2020년 4월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by