% Comparison between Euler and true solution

example_an = @(t,y) 4*exp(0.8*t)-0.5*y;
solution_an = @(t,y) 4/1.3*(exp(0.8*t)-exp(-0.5*t))+2*exp(-0.5*t);

[t, yeu] = eulode(example_an,[0 4],2,1);
ytrue = solution_an([0:1:4]);

disp('     t       y_Euler   y_true   relative error (%)')
disp([t', yeu', ytrue', (abs(ytrue-yeu)./ytrue*100)'])