y = deval(___,idx) returns
only the solution components with indices listed in the vector idx.
You can use either of the previously listed input argument combinations.

Solve the simple ODE y' = t^2 with initial condition y0 = 0 in the interval 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.

Evaluation points, specified as a vector. x specifies
the points at which you want the value of the solution. The elements
of x must be contained in the original integration
interval, [sol.x(1) sol.x(end)]. For each index i,
the solution y(:,i) corresponds to x(i).

Interpolated solution, returned as a vector or matrix. The number
of rows in y is equal to the number of solution
components being returned.

For multipoint boundary value problems, the solution obtained
by bvp4c or bvp5c might
be discontinuous at the interfaces. For an interface point xc,
the deval function returns the average of the
limits from the left and right of xc. To get the
limit values, set the value of x to be slightly
larger or smaller than xc.

Derivative of continuous solution produced by sol,
returned as a vector or matrix. yp is the same
size as y and indicates the slope of the interpolating
function used by sol at each solution point in y.