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. zdot(1) = C1 *( ( z(2) ) ) ; zdot(2) = C2 * ( - sin(z(1)) -.1*z(1) + 10* sin(t) ) ; end % optional end statement