Your X values are out of order causing the graph to look strange. If you were to sort those values it will help smooth out the graph.
How to make a smoother pdf plot?
8 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to plot X versus it pdf value (Y) using gamma function. the plot i get (Ex#1) is very strange. I want to have a plot like Ex#2. Below is my code so far and i would appreciate any help.
X= [0.78;0.33;0.34;0.12;0.19;0.08;0.13;0.01;0.16;0.1;0.14;0.57;0.6;0.18;0.16;0.62;1.23;0.67;0.43;1.03];
G1=makedist('gamma','a',1.26,'b',0.31);
Y=pdf(G1,X);
plot(X,Y,'LineWidth',2)
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!