Here is an example of a single first-order differential equation:

function xdot = f(x,t)
xdot(1)=-x(1);
endfunction;
x0=[1];
t=linspace(0,6,50)’;
x=lsode(“f”,x0,t);
plot(t,x)

Here is a system of differential equations;
both dependent variables are shown in the picture;

function xdot = f(x,t)
xdot(1)=-.5*x(2);
xdot(2)=x(1);
endfunction;
x0=[0;2];
t=linspace(0,10,50)’;
x=lsode(“f”,x0,t);
plot(t,x)

The first example is solving {dxover dt}=-.5 x with x(0)=1, on  0leq tleq 6.

The second example is solving

{dx_1over dt}=-.5 x_2 and {dx_2over dt}=x_1 with x_1(0)=0 and x_2(0)=2, on  0leq tleq 6.