I want to sort descending of my matrix each row with maple, $$ A= \begin{bmatrix} 0&-1&2\\-3&0&5\\-1&-5&0 \end{bmatrix} $$
become
$$ A= \begin{bmatrix} 2&0&-1\\5&0&-3\\0&-1&-5 \end{bmatrix}. $$
I typing in maple :
restart:
with(linalg):
A := matrix(3, 3, [0, -1, 2, -3, 0, 5, -1, -5, 0]):
evalm(sort(A, `>`));
But the result same as $A$. How to sort descending each row of matrix $A$?
As a question about Maple programming (rather than about mathematics) this question belongs on either www.stackoverflow.com or www.mapleprimes.com .
I'm not sure which version of Maple you're using, but lowercase
matrixis deprecated in favour ofMatrix(available since Maple 6 released in the year 2000).Here are two ways to get that, using
Matrix,If you insist on using the deprecated
matrixthen you can use the second approach above.