Can anyone debug the following code?
1 次查看(过去 30 天)
显示 更早的评论
The code is given below. The problem I am facing is while bringing two plots together using hold on function the result is not the exact result what I am getting in the seperate window. variable K is attached. Thanks
figure,histogram(K);hold on;
pd= fitdist(K','Kernel');
x_values = -30:0.1:40;
y = pdf(pd,x_values);
plot(x_values,y,'LineWidth',2)
0 个评论
采纳的回答
Bekay.Kang
2016-8-12
becuase two plots have different y-axis scale! you have to modify y-axis scale!
%code
figure,hist(K);hold on;
pd= fitdist(K','Kernel');
x_values = -30:0.1:40;
y = pdf(pd,x_values);
plot(x_values,y*(max(hist(K))/max(y)),'r','LineWidth',2)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!