Question
The Rayleigh distribution is a random number distribution that appears in many practical problems. A Rayleigh - distributed random value can be created by taking
The Rayleigh distribution is a random number distribution that appears in many practical problems. A Rayleigh - distributed random value can be created by taking the square root of the sum of the squares of two normally distributed random values. In other words, to generate a Rayleigh - distributed random value ? , get two normally distributed random values between 0 and 1 ( ? 1 and ? 2 ), and perform the following calculation: ? = ? ? 1 2 + ? 2 2 Write a MATLAB function rayleigh.m with the following syntax: r = r ayleigh(n,m) that returns an n x m array of Rayleigh - distributed random numbers. If only one argument is supplied [rayleigh(n)], the function should return an n x n array of Rayleigh - distributed radom numbers. Be sure to design your function with input argument checking and with proper documentation for the MATLAB help system. Then, write an m - file (MAE1090_Lab11_1.m) to test your function by creating an array of 2 0 0,000 Rayleigh - distributed random values and plotting a histogram of the distribution. Be sure to include a title and axis labels.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started