Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format long
- kvoter = [];
- kvoterrk = [];
- for n=1000:1000:10000
- [t1,y1] = feuler([0.5,0]',5, 1*n);
- [t2,y2] = feuler([0.5,0]',5, 2*n);
- [t4,y4] = feuler([0.5,0]',5, 4*n);
- kvotnogcalc = (y1(end,1)-y2(end,1))/(y2(end,1)-y4(end,1));
- kvoter = [kvoter, kvotnogcalc];
- end
- for n=1000:1000:10000
- [t1,y1] = rk4([0.5,0]',5, 1*n);
- [t2,y2] = rk4([0.5,0]',5, 2*n);
- [t4,y4] = rk4([0.5,0]',5, 4*n);
- kvotnogcalcrk = (y1(end,1)-y2(end,1))/(y2(end,1)-y4(end,1));
- kvoterrk = [kvoterrk, kvotnogcalcrk];
- disp(y1(end,1))
- disp(y2(end,1))
- disp(y4(end,1))
- end
- table1 = table(kvoter(1:2:end)',kvoterrk(1:2:end)')
- writetable(table1,'kvottabell.xlsx')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement