function X=Rayleigh %Function that generates the Rayleigh variable X X = sqrt(-2*log(rand)); end