h=0.1 ; %timestep Tmax=4; tlist=linspace(0,Tmax,Tmax/h +1) ; xlist=zeros(1,length(tlist)); %initialize x0=1; xlist(1)=x0; for n=1:length(tlist)-1 xlist(n+1)=xlist(n) + xlist(n)*h; end figure set(gca,'FontSize',16) plot(tlist,xlist,'o'); hold on tlistfine=linspace(0,Tmax,10000); plot(tlistfine,exp(tlistfine)); %exact solution x=exp(t) xlabel('t','Fontsize',20); ylabel('x(t)','Fontsize',20); legend('Euler Approx','Exact Solution')