omment">%      maximize    log det V*diag(lambda)*V'</span>
<span class="comment">%      subject to  sum(lambda)=1,  lambda &gt;=0</span>
<span class="comment">%</span>

<span class="comment">% setup the problem and solve it</span>
cvx_begin
  variable <span class="string">lambda(p)</span>
  maximize ( det_rootn( V*diag(lambda)*V' ) )
  subject <span class="string">to</span>
    sum(lambda) == 1;
    lambda &gt;= 0;
cvx_end
lambdaD = lambda; <span class="comment">% save the solution for confidence ellipsoid