How do I sort all the columns of a table based on the first column?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Bhavishey Thapar
il 20 Lug 2022
Commentato: Bhavishey Thapar
il 20 Lug 2022
I am trying to sort a table which contains datetime values in the first column and corresponding temperatures in the second column. I want to sort the table by datetime without affecting the relationship between datetime and the temperatures.
For example, if a table looks like this:
Date Temperature
2022-06-01 21
2022-05-29 18
2022-05-21 19
2022-06-04 25
2022-06-02 22
I want it to be sorted like below:
Date Temperature
2022-05-21 19
2022-05-29 18
2022-06-01 21
2022-06-02 22
2022-06-04 25
How do I achieve this?
0 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
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!