%% Set Bound Constraints for a Portfolio Object
% Suppose you have a balanced fund with stocks that can range from 50% to 75% of your portfolio and bonds that can range from 25% to 50% of your portfolio. Use setBounds to set the bound constraints for a balanced fund. Note that this sets default 'Simple' BoundType, which enforces 0.5<=x1<=0.75, 0.25<=x2<=0.5.

lb = [ 0.5; 0.25 ];
ub = [ 0.75; 0.5 ];

p = Portfolio;
p = setBounds(p, lb, ub);
disp(p.NumAssets);
disp(p.LowerBound);
disp(p.UpperBound);

% Copyright 2015 The MathWorks, Inc.