function varargout = ode2_file(t,y,flag,p1,p2) %ODEFILE for version 5.2
switch flag
 case ''                                 % Return dy/dt = f(t,y).
   varargout{1} = f(t,y,p1,p2);
 case 'init'                             % Return default [tspan,y0,options].
   [varargout{1:3}] = init(p1,p2);
 case 'jacobian'                         % Return Jacobian matrix df/dy.
   varargout{1} = jacobian(t,y,p1,p2);
 case 'jpattern'                         % Return sparsity pattern matrix S.
   varargout{1} = jpattern(t,y,p1,p2);
 case 'mass    '                         % Return mass matrix M(t) or M.
   varargout{1} = mass(t,y,p1,p2);
 case 'events'                           % Return [value,isterminal,direction].
   [varargout{1:3}] = events(t,y,p1,p2);
 otherwise
   error(['Unknown flag ''' flag '''.']);
 end
% --------------------------------------------------------------------------
function dydt = f(t,y,p1,p2)
dydt = < Insert a function of t and/or y, p1, and p2 here. >

% -------------------------------------------------------------
function [tspan,y0,options] = init(p1,p2)
 tspan = < Insert tspan here. >;
 y0 = < Insert initial conditions here. >;
 options = < Insert options = odeset(...) or [] here. >;
% ------------------------------------------------------------
function dfdy = jacobian(t,y,p1,p2)
 dfdy = < Insert Jacobian matrix here. >;
% ------------------------------------------------------------
 function S = jpattern(t,y,p1,p2)
 S = < Insert Jacobian matrix sparsity pattern here. >;
% ------------------------------------------------------------
function M = mass(t,y,p1,p2)
 M = < Insert mass matrix here. >;
% ------------------------------------------------------------
function [value,isterminal,direction] = events(t,y,p1,p2)
  value = < Insert event function vector here. >
  isterminal = < Insert logical ISTERMINAL vector here.>;
  direction = < Insert DIRECTION vector here.>;

