samedi 20 août 2016

To use "normrnd" with parameter array without "for loop" in MATLAB

I need a clever idea to use "normrnd" with parameter array without "for loop" in MATLAB.

mu, sig are 20000x2 matrix.

n = 1e6;
x = zeros(2e4,2,n);

for i=1:n
    x(:,:,i) = normrnd(mu,sig);
end

Thank you.




Aucun commentaire:

Enregistrer un commentaire