"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].
"helper " <spamless@nospam.com> wrote in message
<fu751h$qq2$1@fred.mathworks.com>...
> "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].
>
>
Many thanks. I ended up plotting it to check. I wasn't aware
I could open the code to check it. How would I do this?
"Jason " <j_henderson44@REMOVEhotmail.com> wrote in message
>
> Many thanks. I ended up plotting it to check. I wasn't aware
> I could open the code to check it. How would I do this?
>
> Thanks.
Oops forget that. Fairly obvious. Thanks for suggestion.
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.