function out = ex2ode(t,y,flag)

% Copyright 1999, The MathWorks, Inc.

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