Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: random variables-rayleigh distribution
Replies: 1   Last Post: Jan 10, 2013 1:37 PM

 Messages: [ Previous | Next ]
 Roger Stafford Posts: 5,929 Registered: 12/7/04
Re: random variables-rayleigh distribution
Posted: Jan 10, 2013 1:37 PM

"maryam" wrote in message <kcm0ul\$ku\$1@newscl01ah.mathworks.com>...
> I want add a clutter model with rayleigh distribution by random command to a 100-by-40 A matrix,
> but I just want to add this distribution to matrix from 0th row to 10th row and 50th row to 70th and 90th row to 100th.

- - - - - - - - - -
In matlab the zeroth row is not allowed. Indices start with 1, so I'll modify your request in that respect.

p = [1:10,50:70,90:100];
A(p,:) = A(p,:) + s*sqrt(-2*log(rand(length(p),size(A,2))));

where s is the sigma parameter. The mean value of the addition would be

sqrt(pi/2)*s and the variance (4-pi)/2*s^2.

Or you can use the statistical toolbox function, 'raylrnd'.

Roger Stafford

Date Subject Author
1/10/13 maryam
1/10/13 Roger Stafford