The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Roger Stafford

Posts: 5,929
Registered: 12/7/04
Re: random variables-rayleigh distribution
Posted: Jan 10, 2013 1:37 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"maryam" wrote in message <kcm0ul$ku$>...
> 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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.