Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
random variables-rayleigh distribution

Subject: random variables-rayleigh distribution

From: maryam

Date: 10 Jan, 2013 09:17:10

Message: 1 of 2

Dear friend
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.
how can I do that?
thanks & best regards

Subject: random variables-rayleigh distribution

From: Roger Stafford

Date: 10 Jan, 2013 18:37:10

Message: 2 of 2

"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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us