%% Set Turnover Constraint for a MAD Portfolio Object
% Given PortfolioMAD object p, to ensure that average turnover is no more than 30% with an initial portfolio of 10 assets in a variable x0, use the setTurnover method to set the turnover constraint.

x0 = [ 0.12; 0.09; 0.08; 0.07; 0.1; 0.1; 0.15; 0.11; 0.08; 0.1 ]; 
p = PortfolioMAD('InitPort', x0);
p = setTurnover(p, 0.3);

disp(p.NumAssets);
disp(p.Turnover);
disp(p.InitPort);

% Copyright 2015 The MathWorks, Inc.