Sort rows of a table based on vector
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Erik J
am 11 Dez. 2020
Beantwortet: Stephen23
am 12 Dez. 2020
I have a table, Table_A, with 500 elements.
I have a vector, x, with number 1:500 in a random order.
I want to rearrange the table based on the values of x. For example, if the first three elements of x are 383, 24, 191, then the 393rd row of Table_A will be moved to row 1, the 24th row will be moved to row 2, the 191st row will be moved to row 3 and so on.
Any help is appreciated.
Thank you.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!