Q:

Generating Random two-dimensional points in Matlab

I am newbie in Matlab , and I am trying to generate two-dimensional random numbers based on Gaussian (normal) distribution and uniform distribution. assume that I want to create a 2 different dataset (Gaussian(1800 pairs) and Uniform(1200 pairs)) which is going to use for Data mining tasks/algorithms (over-fitting in two-dimensional data) example.
other important issue is that the data points should be in range of 0-20.
I've tried this for Gaussian distribution
SIGMA = [.5 .05; .05 .5 ];
temp = mvnrnd([-3 0], SIGMA,1800);

these codes generates numbers between -5 to 5 and I want to generate 0-20 so I've tried
SIGMA = [0 20];

but I get the range -20 to 20 
How can I get the range of 0-20 ?

A:

Gaussian_r=10+(10/3)*randn(1800,1)

Here i used the 3 sigma rule where 99.7% of the random variables will fall between mean - sigma to mean + 3 sigma which means that there is still 0.3% that might fall outside the area you specified if that's not good enough for you you can make sigma smaller
Uniform_r = 20*rand(1200,1)  

if you want these to be integers use randi instead
check randn randi rand

