clc;
clear all;
yk=0.8;
x0=0;
eps=0.01;
h=0.1;
k=0;
xk=x0;
while(xk<=1+h)
k1=h*rr(xk,yk);
k2=h*rr(xk+(1/2*h),yk+(1/2*k1));
k3=h*rr(xk+(1/2*h),yk+(1/2*k2));
k4=h*rr(xk+h,yk+k3);
T=abs((k2-k3)/(k1-k2));
wyn(k+1,:)=[k, xk, yk, k1, k2, k3, k4, T, h,];
if(T<=0.05)
wyn(k+2,3)=wyn(k+1,3)+(1/6*k1)+(1/3*k2)+(1/3*k3)+(1/6*k4);
else
h=h/2;
continue
end
yk=wyn(k+2,3);
k=k+1;
xk=xk+h;
end
k=4;
xk=0.2;
while(xk<=1+h)
k=k+1;
wyn(k,1)=k-1;
wyn(k,2)=xk;
wyn(k,3)=wyn(k-1,3)+(h/24)*((55*rr(wyn(k-1,2),wyn(k-1,3)))-(59*rr(wyn(k-2,2),wyn(k-2,3)))+(37*rr(wyn(k-3,2),wyn(k-3,3)))-(9*rr(wyn(k-4,2),wyn(k-4,3))));
xk=xk+h;
end
fprintf('Kolejno: k, x, y, s1...s4, T, h');
wyn
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}