Plot multiple probability distribution function side by side
7 次查看(过去 30 天)
显示 更早的评论
Hello,
Please how can I plot the pdf shown in the attached picture.
I can easily plot one pdf but I don't know how to combine them
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/593825/image.jpeg)
% My code is not giving me what I want.
pd = makedist('Normal')
x = -10:.1:10;
pdf_x = pdf(pd,x);
plot(x,pdf_x,'LineWidth',2)
hold on
y = -5:.1:6;
pdf_y = pdf(pd,y);
plot(y,pdf_y,'LineWidth',2)
hold off
0 个评论
采纳的回答
Stephan
2021-4-23
% My code is not giving me what I want.
pd1 = makedist('Normal')
pd2 = makedist('Normal',2,1)
x = -10:.1:10;
pdf_x = pdf(pd1,x);
plot(x,pdf_x,'LineWidth',2)
hold on
y = -5:.1:6;
pdf_y = pdf(pd2,y);
plot(y,pdf_y,'LineWidth',2)
hold off
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!