% Peer Training: Intermediate MATLAB % SCRIPT FILE: numeric_ode.m % Written by Omar Lakkis % Last updated 02/15/00 % Clean up the variables and the figures clear; close all; % parameters maxt = 0.8; %maximum t % Define the function F relative to the ode y' = F(t,y) F = inline('t + y.^2', 't', 'y'); % Then use some ode** solver, ode45 in this case (check the helpdesk) [t,y] = ode45(F,[0 maxt], 1); m = min(y); M = max(y); % plot it plot(t,y) % and adjust the axes axis([0 maxt m M])