mercredi 12 juin 2019

Random numbers in MATLAB, what is this code doing

I have come across this code,

Essentially I need to generate two vectors of random numbers,

Here is the code,

T = 500
     e = normrnd(0,1,[2*T,k]);

        T = size(e,1);
        e = [e(ceil(rand(T,1)*T),:);e];

Why is this method used with ceil? Any ideas on why someone would use this method?




Aucun commentaire:

Enregistrer un commentaire