%% Set Bound Constraints to Define 'Conditional' BoundType Constraints for a PortfolioCVaR 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. To set the bound constraints for a balanced fund with semicontinuous constraints, use setBounds with 'Conditional' BoundType constraints to set xi = 0.25 or 0.5 <= xi <= 0.5 or 0.75 for all i = 1,...NumAssets.

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

p = PortfolioCVaR;
p = setBounds(p,lb,ub,'BoundType',["conditional"; "conditional"]);
disp(p.NumAssets);
disp(p.LowerBound);
disp(p.UpperBound);

% Copyright 2018 The MathWorks, Inc.