ormulation</span>
fprintf(1,<span class="string">'Computing the optimal Markovitz portfolio: \n'</span>);
fprintf(1,<span class="string">'# using the original formulation ... '</span>);

cvx_begin
    variable <span class="string">x1(n)</span>
    minimize ( quad_form(x1,sig) )
    p_mean'*x1 &gt;= r_min;
    ones(1,n)*x1 == 1;
    x1 &gt;= 0;
    sum_largest(x1,r) &lt;= alpha;
cvx_end

fprintf(1,<span class="string">'Done! \n'</span>);
opt1 = cvx_optval;

<span class="comment">% equivalent formulation</spa