DSPRelated.com
Forums

how can i generate psuedo random numbers in matlab?

Started by ali_khodaie2002 August 28, 2009
hi there,
how can i generate psuedo random numbers (by one or different) seed in matlab?
that's very kind of you.
Hi,

You can use sign(randn(N,1)) to generate equally-likely 1s and -1s in a
column-vector of length N. Then convert all the -1s to 0s if you wish. To
change the seed you will need to use options in the randn function. Typing
help randn at the MATLAB command line will give you that information.

HTH
Sameer

On Thu, Aug 27, 2009 at 11:26 PM, ali_khodaie2002 > wrote:

> hi there,
> how can i generate psuedo random numbers (by one or different) seed in
> matlab?
> that's very kind of you.
>
>
>

--
----
Our greatest glory consists not in never falling, but in rising every time
we fall.
-Oliver Goldsmith