Obtain inequality constraint arrays from PortfolioMAD object
[AInequality,bInequality] = getInequality(obj)
[AInequality,bInequality] = getInequality(obj) obtains the inequality constraint arrays from a PortfolioMAD object.
Use dot notation to obtain the inequality constraint arrays from a PortfolioMAD object.
[AInequality, bInequality] = obj.getInequality;
Matrix to form linear inequality constraints [matrix].
Vector to form linear inequality constraints [vector].
To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.
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 PortfolioMAD 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 = PortfolioMAD; p = p.setInequality(A, b); [AInequality, bInequality] = p.getInequality
AInequality = 1 1 1 0 0 bInequality = 0.5000