Set up linear equality constraints for portfolio weights in PortfolioMAD object
obj = setEquality(obj,AEquality,bEquality)
obj = setEquality(obj,AEquality,bEquality) sets up linear equality constraints for portfolio weights.
Given linear equality constraint matrix AEquality and vector bEquality, every weight in a portfolio Port must satisfy the following:
AEquality * Port = bEquality
You can also use dot notation to set up linear equality constraints for portfolio weights:.
obj = obj.setEquality(AEquality, bEquality);
Linear equality constraints can be removed from a PortfolioMAD object by entering  for each property you want to remove.
MAD portfolio object [PortfolioMAD].
Matrix to form linear equality constraints [matrix].
Vector to form linear equality 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 are 50% of your portfolio. Given a PortfolioMAD object p, set the linear equality constraints and obtain the values for AEquality and bEquality:
A = [ 1 1 1 0 0 ]; b = 0.5; p = PortfolioMAD; p = setEquality(p, A, b); [AEquality, bEquality] = getEquality(p)
AEquality = 1 1 1 0 0 bEquality = 0.5000