%% Update Options Structure Using New Options Structure
% Overwrite the corresponding parts of one options structure with a different options structure by using optimset.

oldopts = optimset('Display','iter','TolX',1e-6);
newopts = optimset('PlotFcns','optimplotfval','Display','off');
options = optimset(oldopts,newopts);

% Both oldopts and newopts set the value of the Display option. Check that newopts overwrites oldopts for this option.

options.Display

% Check the values of the other two options.

options.TolX
options.PlotFcns

% Copyright 2018 The MathWorks, Inc.