="comment">% Input data</span>
randn(<span class="string">'state'</span>,0);
n = 10;
W = randn(n); W = 0.5*(W + W');

<span class="comment">% Lagrange dual</span>
fprintf(1,<span class="string">'Solving the dual of the two-way partitioning problem...'</span>);

cvx_begin <span class="string">sdp</span>
    variable <span class="string">nu(n)</span>
    maximize ( -sum(nu) )
    W + diag(nu) &gt;= 0;
cvx_end

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

<span class="comment">% SDP r