creating a vector of independent random cauchy variables...

1 visualización (últimos 30 días)
I would like to create a "1000000 length" vector of cauchy random variables...
The code for one cauchy random variable, x, is:
x= tan(pi*(rand-0.5))
I have a few ways I can think of for generating the vector, but I want the FASTEST computational way.
Thanks
D Howard

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 25 de Feb. de 2012
x = tan(pi*(rand(1000000,1)-0.5));

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by