>% Solution via CVX</span>
fprintf(1,<span class="string">'Find the optimal ellipsoid that seperates the 2 classes...'</span>);

cvx_begin <span class="string">sdp</span>
    variable <span class="string">P(n,n)</span> <span class="string">symmetric</span>
    variables <span class="string">q(n)</span> <span class="string">r(1)</span>
    P &lt;= -eye(n);
    sum((X'*P).*X',2) + X'*q + r &gt;= +1;
    sum((Y'*P).*Y',2) + Y'*q + r &lt;= -1;
cvx_end

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

<span c