Kocarev&Co

y0=1; x(1)=2; y=y0; h=0.1; w(1)=y0; for n = 1:3 k1=h*(-x(n)+w(n)+5); k2=h*(-(x(n)+h)+(w(n)+k1)+5); w(n+1) = w(n)+(k1+k2)/2; x(n+1)=x(1)+(n+1)*h; end plot(x,w);