mercredi 16 novembre 2016

Generating Semi-Random Values based on Other Array in Julia

We start off with an array of values (in this case a 5x32 array):

qpat=rand(5,32)

and we need to generate random values based on the following code (which may need to be altered...will be discussed in a bit):

[rand(Normal(0,1+.5*(1-qpat[n,j])),b,iter) for n=1:length(qpat[:,1]),j=1:length(qpat[1,:])]...)

The goal is to create an array of length=b random values, where the first set (iter being how many sets will be within the first set) of random values of length=b are based on qpat[1,1]. This will then be performed for qpat[1,2] and so on until qpat[end,end] is reached. As qpat is a 5x32 array and 1000 random values are being calculated per value in qpat, the desired final output should contain 160000 values.

As for the code that I mentioned may need to be altered, I do not know if it is calculating the desired output. Can anyone point me in the right direction?

Thank you for your help.

EDIT: b and iter are pre-defined in an earlier step (not shown). I apologize for any confusion this may have caused.




Aucun commentaire:

Enregistrer un commentaire