randn

randn([rng], [dims...])

Generate a normally-distributed random number with mean 0 and standard deviation 1. Optionally generate an array of normally-distributed random numbers.

Examples

julia> randn(3)
3-element Array{Float64,1}:
 0.886264
 0.951379
 0.189251
julia> randn(1,1)
1x1 Array{Float64,2}:
 -1.10013
julia> randn(10^1)
10-element Array{Float64,1}:
 -0.582411
  0.6569  
 -0.364627
 -0.664332
  2.31059 
 -1.29415 
 -0.324598
  0.866415
  0.199852
  0.350528
julia> randn(10^2)
100-element Array{Float64,1}:
 -0.564138
 -0.290903
  2.34801 
  1.15471 
 -1.96972 
  0.232324
 -0.656563
 -2.44173 
  1.20195 
  0.993468
  0.867964
  0.032737
  0.33407 
  ?       
  0.727052
  0.984324
 -0.627767
  0.252516
  0.382487
 -0.5192  
  0.985186
  0.322768
 -0.506415
 -0.994221
  1.0927  
 -0.343862

See Also

bitrand, MersenneTwister, rand, randcycle, randexp, randexp!, randjump, randn, randn!, RandomDevice, randperm, randsubseq, randsubseq!, shuffle, srand,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: