# About Manipulate : How to make this work properly?

Manipulate[
Plot[PDF[NormalDistribution[mu, sigma], x], {x, -4*sigma, 4*sigma}],
{mu, -10, 10}, {sigma, 0, 10}
]


I got the following error:

## 1 Answer

For the code to work without error messages, signa needs an initial value, for instance:

Manipulate[Plot[PDF[NormalDistribution[mu, sigma], x], {x, -4*sigma,
4*sigma}], {mu, -10, 10}, {{sigma, .5}, 0, 10}]


Alternatively, just tolerate the initial error messages, and move the sigma slider to obtain the desired results.

• Thanks. I just realized that it's stupid mistake. Sigma should be >0. – Chen Stats Yu May 21 '15 at 17:30
• Or, if you don't care too much about the error (like if this is going to some other user, who might try any input, including illegal values), using Quiet[ ] around the body of Manipulate might be a safer option. You can also set specific errors/wranings to eliminate. – Bichoy May 22 '15 at 2:57