How can I plot histogram?
3 ビュー (過去 30 日間)
古いコメントを表示
Amer Al-Maashani
2021 年 1 月 29 日
コメント済み: Walter Roberson
2021 年 1 月 29 日
I nedd help to scale the y-axis of Gaussian pdf
for example:
x = linspace(-20,20);
plot(x,normpdf(x,4,4))
How can I plot the histogram of this example?
0 件のコメント
採用された回答
Walter Roberson
2021 年 1 月 29 日
x = linspace(-20,20);
y = normpdf(x, 4, 4);
plot(x,y)
histogram(y, 10)
3 件のコメント
Walter Roberson
2021 年 1 月 29 日
Sure.
x = linspace(-20,20);
y = normpdf(x, 4, 4);
plot(x,y)
hold on
histogram(y, 10)
hold off
Not very useful, though.
Walter Roberson
2021 年 1 月 29 日
I suspect that you are looking for something like the following, but notice that it is exactly opposite to what you asked for.
r = normrnd(10,1,100,1);
histfit(r)
その他の回答 (1 件)
Daniel Pollard
2021 年 1 月 29 日
That link is for the documentation for histogram.
histogram(normpdf(x,4,4))
will do what you want.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!