Reputation: 11
for i in 1:1000
x = rand(Uniform(0,4),100)
mean_array[i] = sum(x)/ 100
end
I wanna generate 1000 dists and calculate the mean of each one and put the means in an array to get another mean from this 1000 means.
Upvotes: 0
Views: 821
Reputation: 42194
Your code can be written as:
mean_array=[mean(rand(Uniform(0,4),100)) for i in 1:100]
Upvotes: 2