%% Set Linear Inequality Constraints
% Suppose you have a portfolio of five assets and you want to ensure that the first three assets are no more than 50% of your portfolio. Given a CVaR portfolio object p, set the linear inequality constraints with the following.

A = [ 1 1 1 0 0 ];
b = 0.5;
p = PortfolioCVaR;
p = setInequality(p, A, b);

disp(p.NumAssets);
disp(p.AInequality);
disp(p.bInequality);

% Copyright 2015 The MathWorks, Inc.