%% Combine Options Structures
% Create two options structures.

opts_1 = odeset('RelTol',1e-8,'AbsTol',1e-9,'OutputFcn',@odeplot,'Stats','on');

%

opts_2 = odeset('Mass',@(t) [t 0; 0 -t],'MStateDependence','none',...
    'MassSingular','no','OutputFcn',@odephas2);

%
% Combine the options structures, giving preference to opts_2. Since both structures contain different values for OutputFcn, the value in opts_2 overrides the one in opts_1.

opts = odeset(opts_1,opts_2)

% Copyright 2012 The MathWorks, Inc.