[英]Histogram fit and kernal Density plot in MATLAB
我想在一幅圖中繪制直方圖擬合度和核密度曲線,在一幀中表示ks密度曲線和histfit。
有人可以幫我怎么做。
我只是呈現一個示例代碼,我想做什么。
非常感謝 。
x = rand([1 50])
figure(1)
histfit(x)
hold on
[f,xi] = ksdensity(x);
hold off
figure
plot(xi,f);
繪圖功能調用不正確。 本質上, hold on
要求MATLAB在此之后繪制所有圖形,與之前的圖形重疊。 hold off
禁用此功能並覆蓋上一個數字。 因此,運行如下代碼:
x = rand([1 50])
figure(1)
histfit(x)
hold on
[f,xi] = ksdensity(x);
plot(xi,f);
hold off
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.