dimanche 27 novembre 2016

MethodError: no method matching /(::Int64,::Array{Int64,1}) when generating random numbers based on Normal Distribution in Julia

I need to construct a multi-element array of random numbers from a normal distribution (using the "Distributions" package for this). I am using the code below.

[rand(Distributions.Normal(0,a[end]+0.5*(1-b[n])),c,length(b[1,:])*d[n]/c) for n=1:length(b)]

where (I am using random numbers for this example):

a=rand(10)
b=rand(5,32)
c=5
d=rand(32)

When I run the code I receive the following error message:

MethodError: no method matching /(::Int64,::Array{Int64,1})

Any ideas on how I can get this to work?

Thank you for your help.

-Alejandro Braun




Aucun commentaire:

Enregistrer un commentaire