Monday, November 07, 2005

uniform distribution of random numbers

Generate a uniform distribution of random numbers on a specified interval [a,b]. To do this, multiply the output of rand by (b-a) then add a.

x = a + (b-a) * rand(5)

No comments:

Post a Comment