x=0y=1a=0b=5h=0.1n=(b-a)/h;f(x(i),y(i))= -2*y(i)+2-e^(-4*x(i))for i=1:nx(i)=a+(i-1)*hx(i+1)=a+i*hy(i+1)=y(i)+h*f(x(i),y(i))endplot(x,y)hold on
MATLAB: Won’t run euler method
eulereuler methodnot working
eulereuler methodnot working
x=0y=1a=0b=5h=0.1n=(b-a)/h;f(x(i),y(i))= -2*y(i)+2-e^(-4*x(i))for i=1:nx(i)=a+(i-1)*hx(i+1)=a+i*hy(i+1)=y(i)+h*f(x(i),y(i))endplot(x,y)hold on
Best Answer