%
function sde2
fprintf('saving to XX.dat\n');
randn('state',1000);
load MT.dat % load in a value for M and T
M=MT(1);
T=MT(2);
Dt=0.01;
K=T/Dt;
Db=zeros(K,M);
beta=zeros(K,M);
XX=zeros(K,M);
sdt=sqrt(Dt);
lambda=-1;
mu=1;
X=randn(1,5);
XX(1,:)=X;
for k=1:K
 Db(k,:)=sdt*randn(1,M);
 X = X + Dt*lambda*fx(X) + mu*gx(X).*Db(k,:);
 XX(k+1,:)=X;
end
time=(0:Dt:T)';
save -ascii XX.dat XX    % save the output to use ;later
%
