How to combine PLOT the output from Density Estimation and Gaussian Function

1 回表示 (過去 30 日間)
balandong
balandong 2017 年 8 月 13 日
Dear coder,
Im interested to plot the output from KSDENSITY as shown below
Using the code from this site, I manage to get the blue and black line. However, I unable to plot the red Gaussian curve. I really appreciate, if someone can show some info on how to solve this problem.
The code
randn('seed',1)
x = [randn(3,1); 3+.5*randn(3,1)];
ksdensity(x)
hold on; h=stem(x,0.01*ones(size(x)),'filled'); hold off
Thanks in advance

回答 (0 件)

カテゴリ

Help Center および File ExchangeExploration and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by