clear;
hold on;

 deltat=0.1;
x1(1)=0;
t(1)=0;

for i=2:1001;
    
    x1(i)=deltat*(-x1(i-1)+t(i-1)*exp(-t(i-1)/10))+x1(i-1);
    t(i)=t(i-1)+deltat;
end;


x2=0;
t=0:deltat:100;

[t,x2]=ode45('kat',t,x2);

plot(t,x1-x2','r');
