randn

  • randn returns a normally distributed random number (with mean = 0 and variance = 1)
  • randn(n,m) returns a n x m matrix of normally distributed random numbers
  • randn(n) is equivalent to randn(n,n)
For tractability use rng function.

Examples

> randn#

 1.29013
> randn(2)#

    -0.197587     0.677411
    -0.855019      1.93203
> randn(2,3)#

    -0.768578     0.247221     0.561918
     0.293378    -0.758055    -0.309597
> scatter(randn(10,10),randn(10,10))

[ans:1x1 struct]

Resources

See also

rand | randi