%% Set the Solver Type as 'fmincon' and Use an optimoptions Structure to Set the Algorithm and Use of Gradients for a PortfolioMAD Object
% Use 'fmincon' as the solverType and use an optimoptions object to set the algorithm to 'active-set' and to set the gradients flag 'on' for 'GradObj' and turn off the display.

p = PortfolioMAD;
options = optimoptions('fmincon','algorithm','active-set','display','off','gradobj','on');
p = setSolver(p, 'fmincon', options);
display(p.solverOptions.Algorithm);
display(p.solverOptions.Display);

% Copyright 2015 The MathWorks, Inc.