%% Obtain Inequality Constraints for a PortfolioCVaR Object
% Suppose you have a portfolio of five assets and you want to ensure that the first three assets constitute at most 50% of your portfolio. Given a PortfolioCVaR object p, set the linear inequality constraints and then obtain values for AInequality and bInequality.

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

% Copyright 2015 The MathWorks, Inc.