# How to draw a random number from Cauchy Distribution with a particular mean and standard deviation?

23 views (last 30 days)
Md. Asadujjaman on 15 Aug 2021
Commented: Md. Asadujjaman on 16 Aug 2021
We can generate a random number from the normal distribution with mean parameter mu and standard deviation parameter sigma using normrnd(mu,sigma). However, how can we generate a random number from the Cauchy distribution using specific mu and sigma;, e.g., mu=0.5 and sigma=0.1?

Chunru on 15 Aug 2021
Edited: Chunru on 15 Aug 2021
Using the fact that Cauchy distribution is the Student's t distribution with dof=1.
mu =4e5; sigma = 20;
r = mu+sigma*trnd(1, 100000, 1); % mu, signam: location and scale parameters (not mean and std)
hist(r, 1000);
Md. Asadujjaman on 15 Aug 2021
Thanks.

### More Answers (1)

Image Analyst on 15 Aug 2021
Md. Asadujjaman on 16 Aug 2021
Thank you.

### Community Treasure Hunt

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

Start Hunting!

Translated by