Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab Help

  1. Nov 12, 2007 #1
    Okay... I am using the randn function for a sequence of normally distributed numbers.
    I am writing a program whereby I need to use this randn to give me random x and y values whose position r is less than 1

    i.e. that is to say that all points fall within a 2 x 2 square centred at (0, 0).
    And I MUST use randn

    Can anyone help me achieve this.

    thanks
     
  2. jcsd
  3. Nov 12, 2007 #2
    Do you need the points to have any particular distribution (normal, uniform, etc.)? You could just discard any generated points that fall outside the 2 x 2 square, but then the points will not have a normal distribution.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Matlab Help
  1. MATLAB help (Replies: 9)

  2. MATLAB help (Replies: 2)

  3. MATLAB help (Replies: 0)

  4. MATLAB help (Replies: 7)

  5. Matlab help (Replies: 6)

Loading...