how to Plot improved Euler's Method
20 views (last 30 days)
Dina Abd Elkader on 31 Mar 2021
I am trying to plot Improved Euler's method but I only get an empty graph. I have no idea what is wrong. Here is my code.
fprintf('Imp Euler With h=0.1')
fprintf('x y(Imp. Euler) y(Actual) \n')
fprintf('%f\t %f\t %f\t \n',x0,y,f(x0));
y = y + (h*((i1+i2)/2));
fprintf('%f\t %f\t %f\t \n',x,y,f(x));
legend ('Improved Euler')
Reshma Nerella on 5 Apr 2021
Edited: Reshma Nerella on 5 Apr 2021
When you try to plot a line with scalar inputs, the plot doesn't show up in the figure unless you use a Marker like *, +, . etc
In this line of code
x, y are scalars. Since you didn't specify any Marker, you got an empty figure.
Hope this helps!