aboutsummaryrefslogtreecommitdiffstats
path: root/math2373/lab6/approx.m
blob: 8fb87f275be560a5ec9bbd9f4f458b9d7b127171 (plain) (blame)
1
2
3
4
5
6
z=8-2*2-7*exp(-2/2);%exact solution at t=2
for k=1:5
    N=5*2^(k-1);eulerN;
    %difference between Euler approximation and exact solution at t=2.
    error(k)=y(N+1)-z;
end