%systems_rhs.m
function zdot = systems_rhs( t, z )   
% systems_rhs evaluates the right hand side of the ODE that is being
% solved.   

% ODE23 calls this function many times when finding its numerical
% solution to the ODEs.

global C1 C2   % this matches the global command in the script file.

% The next two lines define the system of equations to be solved.
% They would be three lines for a third order system, etc.

x=z(1);     v=z(2);

xdot = C1*v;   vdot = C2*v;

zdot = [xdot vdot]';  %note the '.  A column vector is needed.
return    % optional end statement at the end of a function file
