Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How to plot numerical solution of differential equations?
My problem is how to plot the exact and the approximated solutions?
This is the Matlab M-file for solving differential equations with Euler's Method.
disp(' Euler Method ')
disp('ti f(ti,yi) yi exact error')
fprintf('%4.2f ----------- %12.6f %12.6f %4.2f
g=exp(-t)+2*t-2; (exact solution)
fprintf('%4.2f %12.6f %12.6f %12.6f %8.2e
fprintf('%4.2f %12.6f %12.6f
0 · ·