To view a direction field for an ODE, run the program dfield
in the Matlab command window.
>> dfield
>>
This should open and applet that allows you to input a one-
dimensional non-autonomous vector field for an ODE. This
has the form
x' = f(x,t)
Here, x and t are scalars, and the function f(x,t) comprises the
vector field whose integral curves are the solutions to the ODE.
The applet plots f(x,t) on the Cartesian plane whose axes are
the x and t axes. If you left-click the mouse on a point in the
plane, then dfield will integrate the vector field to produce the
solution to the ODE for the initial condition given by the point
you chose.
The applet has options to choose a t-min and t-max, and the
same for x. It also allows you to define parameters, which is
convenient for situations where one wants to integrate a vector
field for several values of a parameter. For example
x' = a*sin(x^2) + b*cos(a*t)