function out = ex1ode(t,y,flag)

% Copyright 1999, The MathWorks, Inc.

global KAPPA LAMBDA EPSILON

if nargin < 3 | isempty(flag) 
  out = [ (- y(1) + (y(1) + KAPPA - LAMBDA) * y(2))
           (y(1) - (y(1) + KAPPA) * y(2)) ];
else
  switch(flag)           
  case 'mass'
    out = diag([1 EPSILON]);
  otherwise
    error(['Unknown flag ''' flag '''.']);
  end
end
