vendredi 29 mai 2015

Setting the seed for betarnd() in Matlab 2014b

I am trying to set the seed for betarnd() so that every time I re-run my code, I use the same values generated by betarnd(). In a previous version of Matlab on someone else's computer, it suffices to do

randn('seed', num)
rand('seed', num)

and she can get the same set of random values sampled from the beta distribution each time betarnd(0.5,0.5,[1,15]) is run, for instance. However, in my case, although I set the seeds as shown above, I get different values. What could be causing this discrepancy? And how can I resolve it?




Aucun commentaire:

Enregistrer un commentaire