Hello, I need some help with the code below.The solutions is probably very simple but I am unable to get it to work. I need to know how to restart the counter, k, back to zero for the loop within the loop and store the X=k values from the initial loop. The program basically should run one trial, store the result, then run the trail again with a different with the same condition as the first. I had attempted but unable to do it. Any advice will help. Thanks
lambda= 5;n=100;U= rand (1,n);i=1;k=0F= exp(-lambda);while (i<=n)while (U(1,i)>=F); k=k+1 F=F+exp(-lambda)*lambda^k/;end;i=i+1end
Best Answer