Documentation 
Meanvariance efficient frontier
As an alternative to frontcon, use the Portfolio object (Portfolio) for meanvariance portfolio optimization. This object supports gross or net portfolio returns as the return proxy, the variance of portfolio returns as the risk proxy, and a portfolio set that is any combination of the specified constraints to form a portfolio set. For information on the workflow when using Portfolio objects, see Portfolio Object Workflow.
[PortRisk, PortReturn, PortWts] = frontcon(ExpReturn,
ExpCovariance, NumPorts, PortReturn, AssetBounds, Groups,
GroupBounds, varargin)
ExpReturn  1 by number of assets (NASSETS) vector specifying the expected (mean) return of each asset. 
ExpCovariance  NASSETSbyNASSETS matrix specifying the covariance of asset returns. 
NumPorts  (Optional) Number of portfolios generated along the efficient frontier. Returns are equally spaced between the maximum possible return and the minimum risk point. If NumPorts is empty (entered as [], frontcon computes 10 equally spaced points. When entering a target rate of return (PortReturn), enter NumPorts as an empty matrix []. 
PortReturn  (Optional) Vector of length equal to the number of portfolios (NPORTS) containing the target return values on the frontier. If PortReturn is not entered or [], NumPorts equally spaced returns between the minimum and maximum possible values are used. 
AssetBounds  (Optional) 2byNASSETS matrix containing the lower and upper bounds on the weight allocated to each asset in the portfolio. Default lower bound = all 0s (no shortselling). Default upper bound = all 1s (any asset may constitute the entire portfolio). 
Groups  (Optional) Number of groups (NGROUPS)byNASSETS matrix specifying NGROUPS asset groups or classes. Each row specifies a group. Groups(i,j) = 1 (jth asset belongs in the ith group). Groups(i,j) = 0 (jth asset not a member of the ith group). 
GroupBounds  (Optional) NGROUPSby2 matrix specifying, for each group, the lower and upper bounds of the total weights of all assets in that group. Default lower bound = all 0s. Default upper bound = all 1s. 
varargin  (Optional) varargin supports the following parametervalue pairs:

[PortRisk, PortReturn, PortWts] = frontcon(ExpReturn, ExpCovariance, NumPorts, PortReturn, AssetBounds, Groups, GroupBounds, varargin) returns the meanvariance efficient frontier with userspecified asset constraints, covariance, and returns. For a collection of NASSETS risky assets, computes a portfolio of asset investment weights that minimize the risk for given values of the expected return. The portfolio risk is minimized subject to constraints on the asset weights or on groups of asset weights.
PortRisk is an NPORTSby1 vector of the standard deviation of each portfolio.
PortReturn is a NPORTSby1 vector of the expected return of each portfolio.
PortWts is an NPORTSbyNASSETS matrix of weights allocated to each asset. Each row represents a portfolio. The total of all weights in a portfolio is 1.
frontcon generates a plot of the efficient frontier if you invoke it without output arguments.
The asset returns are assumed to be jointly normal, with expected mean returns of ExpReturn and return covariance ExpCovariance. The variance of a portfolio with 1byNASSETS weights PortWts is given by PortVar = PortWts*ExpCovariance*PortWts'. The portfolio expected return is PortReturn = dot(ExpReturn, PortWts).