%% Slope of Interpolating Function
% Solve the simple ODE y' = t^2 with initial condition y0 = 0 in the interval [0, 3] using ode23.

sol = ode23(@(t,y) t^2, [0 3], 0);

%
% Evaluate the solution at seven points. The solution structure sol contains an interpolating function that deval uses to produce a continuous solution at these points. Specify a second output argument with deval to also return the derivative of the interpolating function at the specified points.

x = linspace(0,3,7);
[y,yp] = deval(sol,x)

% Copyright 2012 The MathWorks, Inc.