Azzera filtri
Azzera filtri

Sorting Columns of a table.

8 visualizzazioni (ultimi 30 giorni)
Isaac Osei Agyemang
Isaac Osei Agyemang il 8 Ott 2018
Commentato: Guillaume il 8 Ott 2018
I have a table with two columns without any title, i want to sort the numbers in the table in an order. I've a ttached a picture of my table to the question.
  5 Commenti
Walter Roberson
Walter Roberson il 8 Ott 2018
graph() accepts numeric s and t arrays. categorical too I think.
Guillaume
Guillaume il 8 Ott 2018
Yes, the edges can be numeric (and usually are), the node names cannot be numeric.
However, looking at the discussion in the other identical question, that wx appears to be simply a copy of the Edge table, not something generated from the Node table, so you are right, the values in wx should be numeric.

Accedi per commentare.

Risposte (2)

KSSV
KSSV il 8 Ott 2018
Okay you can sort them in the way you want. Have a look on the function sort. With this you can sort.

Guillaume
Guillaume il 8 Ott 2018
Modificato: Guillaume il 8 Ott 2018
If you want to sort wx according to the numeric values:
[~, order] = sortrows(str2double(wx.EndNodes));
wx = wx(order, :);

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by