How can I plot histogram?

2 views (last 30 days)
Amer Al-Maashani
Amer Al-Maashani on 29 Jan 2021
Commented: Walter Roberson on 29 Jan 2021
I nedd help to scale the y-axis of Gaussian pdf
for example:
x = linspace(-20,20);
How can I plot the histogram of this example?

Accepted Answer

Walter Roberson
Walter Roberson on 29 Jan 2021
x = linspace(-20,20);
y = normpdf(x, 4, 4);
histogram(y, 10)
Walter Roberson
Walter Roberson on 29 Jan 2021
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);

Sign in to comment.

More Answers (1)

Daniel Pollard
Daniel Pollard on 29 Jan 2021
Simply googling "matlab histogram" would have answered your question.
That link is for the documentation for histogram.
will do what you want.


Community Treasure Hunt

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

Start Hunting!