(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

Plot a suitably scaled normal distribution on top of a histogram made with 100 random values.

3. The attempt at a solution

x = -2,9:0.1:2.9;

y = randn(100,1);

nd = exp(-x.^2/2)/sqrt(2*pi);

hist(y,x);

hold on;

plot(x,nd);

plot(-x,nd);

holf off;

This is not working. What am I doing wrong? Also how do I ensure that it is suitably scaled?

Thanks

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: MATLAB Question?

**Physics Forums | Science Articles, Homework Help, Discussion**