MATLAB: How to create an vector contains 10000 random values that uniformly distributed with mean 1 and variance 10

how to create an vector contains 10000 random values that uniformly distributed with mean 1 and variance 10 ?

Best Answer

mean = 1.0;
std = sqrt(10);
N = 10000;
u = (mean-sqrt(12)/2*std) + sqrt(12)*std*rand(N,1)
u is uniformly distributed on
[a:b] = [m-sqrt(12)/2*std:m+sqrt(12)/2*std]
with the prescribed mean and standard deviation.