variables y{n}
    minimize( ( n - 1 : -1 : 0 ) * diag( X ) );
    for k = 0 : n-1,
        sum( diag( X, k ) ) == b( k+1 ) : y{k+1};
    end
    X == semidefinite(n);
cvx_end
</pre></div>
</div>
<p>The statement <tt class="docutils literal"><span class="pre">dual</span> <span class="pre">variables</span> <span class="pre">y{n}</span></tt> allocates a cell array of
<span class="math">\(n\)</span> dual variables, and stores the result in the Matlab variable
<tt class="docutils literal"><span class="pre">Z</s