function diffusion(h) x=0:h:3; n=length(x); alea=sqrt(h)*rand(2,n,"normal"); res=zeros(2,n); res(2,1)=0.1; for j=1:(n-1) res(1,j+1)=res(1,j)+1*h+alea(1,j); res(2,j+1)=res(2,j)+res(2,j)*h+alea(2,j); end subplot(1,2,1) plot2d(x,res(1,:)) plot2d(x,x) subplot(1,2,2) plot2d(x,res(2,:)) plot2d(x,0.1*exp(x)) endfunction