I think I can simplify the code by replacing:
tt = (1+t(i)-t(1:i))*ones(1,Nr);
e1 = ones(i,1);
ex = e1*x(i,:);
ey = e1*y(i,:);
exp1 = exp(-.25*((ex-x(1:i,:)).^2+(ey-y(1:i,:)).^2)./tt);
x(i+1,:) = x(i,:) + adt*sum((ex-x(1:i,:))./tt.^2.*exp1) + edt*randn(1,Nr);
y(i+1,:) = y(i,:) + adt*sum((ey-y(1:i,:))./tt.^2.*exp1) + edt*randn(1,Nr);
by this:
tt = (1+t(i)-t(1:i));
exp1 = exp(-.25*((x(i,:)-x(1:i,:)).^2+(y(i,:)-y(1:i,:)).^2)./tt);
x(i+1,:) = x(i,:) + adt*sum((x(i,:)-x(1:i,:))./tt.^2.*exp1) + edt*randn(1,Nr);
y(i+1,:) = y(i,:) + adt*sum((y(i,:)-y(1:i,:))./tt.^2.*exp1) + edt*randn(1,Nr);
am I right?
In any case, the computation of the exp1 is what takes the most time (followed by the sum), so I don't know if this change much regarding computation time.