Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shuffle/randomize some delays
#1
Hi,

I have been using some protocol code that have been modified in order to be able to shuffle an initial delay (see the code:
https://gist.github.com/eurekaneuro/5d87...ff7f16a4d1
), lines 52 to 61. I was wondering if they would be an easiest way to shuffle/randomize several delays other than just 2 and 3 (S.InitialDelayMean = [2 3]), like in this code, by using the function Shuffle still.

Thank you,
Sarah
[url=https://gist.github.com/eurekaneuro/5d87b249e6b59ec24a5fa0ff7f16a4d1][/url]
Reply
#2
I'm not sure what the Shuffle() function is.
If you set S.InitialDelayMean to equal a longer vector (i.e. [1 2 3 4]), does it work?
If you want to draw a random value from S.InitialDelayMean with replacement, you can use:

ThisValue = S.InitialDelayMean(round(rand*length(S.InitialDelayMean)))
Reply


Forum Jump: