×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Statistical distributions

Statistical distributions

Statistical distributions

(OP)
The question is about the Rayleigh random distribution.

If I use the command v=b^2*raylpdf(x,b) with x=[0:0.1:1000]
and b=249 I obtain a maxwellian distribution for the velocity v.

If now I want to do the same thing with the random generator raylrnd using the command v(i)=b^2*raylrnd(b) into a for cycle I obtain a distribution that has the correct shape but the values of v are totaly screwed up. If I omit the b^2 I obtain almost the correct values, but looking at matlab documentation I should include b^2. Is this a bug or am I missing something?

Thanks

RE: Statistical distributions

This is a vectorize mistake.

Try the vewctor notation instead of the scalar.  Add a dot everywhere.

Use parens to clarify.

= b .^ 2
is different from
= b ^ 2

Do you want b .^ ( 2 * ralylrnd( b ) )?

jsolar

RE: Statistical distributions

(OP)
b is a scalar, therefore b.^2 is exactly the same of b^2.

RE: Statistical distributions

(OP)
Anyway I think I solved the problem myself.

Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources