Hi,
I want to generate x with 10 numbers which are uniformly distributed between [-100,100]. Can you please tell which method is preferable? Are both methods are correct?
Method 1:
N = 10;
x = (-1:2/N:1-1/N).* 100;
Method 2:
uRand = rand(1,N);
x = (uRand.*2-1).*100;
Best Answer