Problem 231. Differential equations I

Given a function handle f an initial condition y0 and a final time tf, solve numerically the differential equation

dy/dt = f(y)

for the function y(t) between t=0 and t=tf. Give as a result res=y(tf).


   f = @(x) -x;
   tf= 1;
   y0= 1;
 => y(tf) = 1/e = 0.367879441171442

Remarks: aim at a relative precision of around 1e-6. The function is analytic in the interval [0,1].

Solution Stats

38.18% Correct | 61.82% Incorrect
Last solution submitted on Jun 08, 2016
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!