MATLAB: How to plot histogram

pdf

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?

Best Answer

x = linspace(-20,20);
y = normpdf(x, 4, 4);
plot(x,y)
histogram(y, 10)