Random generation...
Random generation...
(OP)
Hello i have a random variable X and want to create 8000 random generated numbers for it with uniform destribution...how do i do it in matlab ? i know that unifrnd(0,1) creates ONE random number between 0 and 1...how do i generate 8000 ? thanks...





RE: Random generation...
You could use the following command.
random = unifrnd(0,1,1,8000);
This creates 8000 random variables uniformly distributed between [0,1]. The info is stored in the vector named random.
RE: Random generation...
to generate an array of length X you can use:
rand_seq = rand(1,X);
This distribution is a continous uniform distribution from 0 to 1 with mean value 0.5.
If you want to create any uniform distribution you can use
rand_seq = V*rand(1,X) + Offset;
In this case V*rand(1,X) generates a c.u.d from 0 to V and you can use Offset to set the mean value of the ditribution.
Example:
rand_seq = 10*rand(1,X) - 5;
generates a c.u.d. from -5 to 5
Hi
lurad75