|
"Corey Adrian" <uryguitarist777@yahoo.com> wrote in message <i1fhko$rsc$1@fred.mathworks.com>...
> I am trying to create a random number array given a minimum, maximum, and mean value. Is there any way to do this?
>
> Thanks,
> Corey
- - - - - - - -
How about using the beta distribution? Let a = minimum, b = maximum, and c = mean. Of course, it is assumed that a < c < b here. Then do:
x = a+(b-a)*betarnd((c-a)/(b-a),(b-c)*(b-a),m,n);
to get an m by n array x of such random numbers.
You can multiply the first two arguments of betarnd by any common factor to change the distribution's variance at your pleasure without affecting the mean. By making this factor very large you can approach Steven's interesting suggestion.
Roger Stafford
|