Q:

julia returning array results in nothing

I have the following code,
function sample_gaussian(n; mean=0., variance=0.01)
  # n samples from standard gaussian
  x = randn(n);
  z = sqrt(variance) .* x .+ mean;
  return z;
end

When I try to call z = sample_gaussian(100) and print it, I get that z is nothing. Can anyone help to explain please?

A:

Please accept this answer so it's clear there was resolution :)

works for me (try it in a new REPL session). my best guess is that you have some old definition of sample_gaussian that you are not updating correctly – David Varela Jan 9 at 2:38

