MATLAB: Create random number with gaussian distribution

random number generator

I need to create a random number with gaussian distribution and with average value of 0 and var of 1. like N(0,1). and also a N(0,10). how can i do this with matlab?

Best Answer

For one single number, use
R = normrnd(0,1)
for an 1x10 array:
R = normrnd(0,1,[1 10])