|
"Jason " <j_henderson44@REMOVEhotmail.com> wrote in message
<fu73b1$gc9$1@fred.mathworks.com>...
> Hello,
>
> I am currently doing some stats in MATLAB.
>
> I've been using
>
> R = normrnd(mean,sigma,[100 1])
>
> to generate 100 random numbers from a normal distribution
> with "mean" and standard deviation "sigma".
>
> I now want to do the same for a uniform distribution.
>
> Is is the case that
>
> R = unifrnd(A.B, [100 1])
>
> is what I should use. Are A and B are the lower and upper
> ranges. The help isn't to specific but I'm assuming this
is
> the case.
>
> Thanks
I agree that the documentation for this function isn't too
specific. One good thing about MATLAB is the fact that you
can open and read many of the functions. If you check out
the code for UNIFRND, you will see it is simply a
fanicified wrapper for the operation:
R = A + (B-A)*rand(m)
where A and B are your lower and upper bounds and m is a 1-
by-2 matrix of sizes [nRows nCols].
|