MATLAB: Reorder Eigenvalues in Schur factorization (Descending order)

ordschur

How can I rearrange the eigenvalues in descending order using ordschur?
I've tried the example below, but unable to rearrange the diagonal of matrix T in descending order.
H = magic(10);
[U,T]=schur(H);
[~, select] = sort(ordeig(T));
[US, TS] = ordschur(U, T, select);

Best Answer

Upon searching and trials, this worked.
H = magic(10);
[U,T]=schur(H);
[~, i] = sort(ordeig(T));
[~, j] = sort(i);
[US, TS] = ordschur(U, T, j);