Hi, I've got a code to fill a matrix with random numbers. However, I haven't found a way to use efficient code and I must use for loop. Here is the code I would like to optimize :
PoissonZ=poissrnd(Lambda,NbTraj,NbDay);for i=1:NbDay for j=1:NbTraj PoissonSauts(j,i)=sum(randn(PoissonZ(j,i),1)); end end
As NbTraj and/or NbDay can achieve quickly high value, the code become very slow… I did not found a way to vectorize it. Thanks for suggestions !
G.
Best Answer