1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Difference rand and randn command matlab

  1. Nov 14, 2013 #1
    i am confused between when to use rand and randn . can someone explain to me please?
  2. jcsd
  3. Nov 15, 2013 #2

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    Both are pseudo-random number generators.

    type "help rand" and "help randn" for a description.

    Code (Text):
    Return a matrix with random elements uniformly distributed
    on the interval (0, 1).  The arguments are handled the same
    as the arguments for `eye'.

    Return a matrix with normally distributed pseudo-random
    elements having zero mean and variance one.  The arguments
    are handled the same as the arguments for `rand'.
    You should be able to see the result by filling a vector with them and plotting.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted