function x=cauchyrnd(a,b,n) %generates a vector of n cauchy random numbers with median a and scale b x=a+b*tan(pi*(rand(1,n)-.5));