MATLAB code to Generate Raleigh Random Variable

AI Thread Summary
The discussion focuses on generating 100,000 Rayleigh random variables in MATLAB using the rand command, specifically with a variance of sigma^2=2. Participants suggest using the raylrnd function for Rayleigh distribution and the hist function for creating histograms, emphasizing the need to normalize the histogram by dividing by 100,000 times the bin width. Additionally, there is a mention of generating pairs of uniform random variables, calculating their ratios, and plotting the histogram to compare with the standard Cauchy density. The Box-Muller transform is referenced as a method for generating random variables. The conversation highlights the importance of understanding these functions for effective data visualization and statistical analysis in MATLAB.
neeraj.patel1
Messages
3
Reaction score
0
What is the Matlab code for generating 100,000 Raleigh Random Variable with sigma^2=2 using rand command only. Generate histogram and normalize it by dividing 1,00,000 times the bin width
 
Physics news on Phys.org
MATLAB code to find ratio of pair of uniform RV

Homework Statement



Generate 100000 pairs of Uniform RV. Find ratio of each pair of RV.Plot histogram and compare to standard Cauchy density.

Homework Equations



rand()
box muller
cauchy=1/pi*(1+x^2)
hist()

The Attempt at a Solution



use box muller to generate rv
 
(two similar threads merged)
 
Back
Top