]> gitweb.michael.orlitzky.com - octave.git/blob - forward_euler1.m
Fix the n != 5 cases in the steepest descent tests.
[octave.git] / forward_euler1.m
1 function y = forward_euler1(x0, y0, f, h)
2 % Compute one iteration of the forward Euler method.
3 %
4 % INPUT:
5 %
6 % * ``x0`` - The initial x-coordinate.
7 %
8 % * ``y0`` - The initial value y(x0).
9 %
10 % * ``f`` - The function y' = f(x,y) of two variables.
11 %
12 % * ``h`` - The step size.
13 %
14 % OUTPUT:
15 %
16 % The approximate value of y(x) at x = x0+h.
17 %
18 y_prime = f(x0,y0);
19 y = y0 + h * y_prime;
20 end