Euler's method
Mostrar comentarios más antiguos
Help

1 comentario
James Tursa
el 13 de En. de 2021
What have you done so far? What specific problems are you having with your code?
Respuestas (2)
WalterWhite
el 13 de En. de 2021
0 votos
Steve Areola
el 5 de Ag. de 2023
0 votos
clc
a=0;b=2;N=10; alph=0.5;
h=(b-a)/N; t(1)=a; w(1)=alph;
f = @(t,y) y-t^2+1;
for i=2:N+1
t(i)=a+(i+1)*h;
w(i)=w(i-1)+h*f(t(i-1),w(i-1));
end
disp("t w")
x=[t;w];
fprintf("%5.9f %5.9f\n",x)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!