2
votes
1answer
55 views

Sorting a matrix except its last row

Given M = {{"Utah", 2}, {"Iowa", 1}, {"Maine", 3}, {"Total", 6}} I want to obtain the reverse-sorted result like this: ...
1
vote
2answers
93 views

How to sort the adjecency matrix of bipartite graph so to have two off-diagonal blocks

In a bipartite graphs there are two class of nodes, say A and B. Each node of class A may interact only with nodes of the class B, and viceversa. The corresponding adjecency matrix is thus composed by ...
0
votes
1answer
65 views

Produce a 1-dimensional list of all unique matrix elements

We have some symbolic matrix m, e.g. m={{1, x, 4 x + y},{0, x y + 4x, 4x},{7 x, x, 4x + x y}} and we want to produce as output a list of all the unique elements ...
1
vote
2answers
125 views

How to sort Table/Matrix including legend(Labellings)

I want to sort table including its legend for graph I have table similar to M1 M2 M3 1 5 2 3 1 4 4 2 -10 5 7 11 6 -2 1 ...
0
votes
1answer
100 views

Sorting a list of triplets by first element of each triplet fails

In the last line of code, I´m trying to order the matrix by the first column. I want to store in the Array t2tlistsorted ( 100 x 3 ), but I can´t. ...
4
votes
2answers
241 views

Sorting a matrix alphanumerically

Somewhat related to Sort matrix by columns and rows without changing them, but more general. I'd like to sort a square matrix (a 3 by 3 in my case, but surely the general solution will treat any), ...
4
votes
6answers
236 views

Sorting Matrix elements

I have matrix in as shown, consisting of real numbers and 0. How can I sort it to become out as shown? ...
1
vote
1answer
208 views

How to Sort on row by row basis?

Say I have matrix how to sort on row by row basis to get: