Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GENERATE SINUSOIDAL DISTRIBUTED RANDOM NUMBERS

6 views
Skip to first unread message

Chetan Mandaliya

unread,
Dec 31, 2009, 8:55:21 AM12/31/09
to
Hi all,
First of all HAPPY NEW YEAR to all.

I want to generate random numbers having sinusoidal distribution (as RANDN generates random numbers having Gaussian distribution). How can i do that. Please help me..........

John D'Errico

unread,
Dec 31, 2009, 10:50:21 AM12/31/09
to
"Chetan Mandaliya" <chetan_m...@ymail.com> wrote in message <hhiag9$cgg$1...@fred.mathworks.com>...

> Hi all,
> First of all HAPPY NEW YEAR to all.
>
> I want to generate random numbers having sinusoidal distribution (as RANDN generates random numbers having Gaussian distribution). How can i do that. Please help me..........

Please define what you mean by a sinusoidal distribution.
Do you mean that the density function has a sinusoidal
shape? Clearly this is impossible, since that would have
infinite mass underneath it, plus a sine wave goes less
than zero.

Do you want numbers over the bounded interval [-1,1]?
This is trivial.

x = sin((rand(N) - 0.5)*pi);

So what is your intent here?

John

0 new messages