n>
fprintf(1,<span class="string">'# using an equivalent formulation by replacing the diversification\n'</span>);
fprintf(1,<span class="string">'  constraint by an equivalent set of linear constraints...'</span>);

cvx_begin
    variables <span class="string">x2(n)</span> <span class="string">u(n)</span> <span class="string">t(1)</span>
    minimize ( quad_form(x2,sig) )
    p_mean'*x2 &gt;= r_min;
    sum(x2) == 1;
    x2 &gt;= 0;
    r*t + sum(u) &lt;= alpha;
    t*ones(n,1) + u &gt;= x2;
    u &gt;= 0;
