I have table with 16 columns, first three are input columns. I want to sort whole table according to first three columns at a time.
T = table(a1, a2, a3, ..., a16)
All a1
, a2
, and a3
will be sorted in ascending order.
For example:
a1 = [6 3 9 6 3 9 6 5]'
a2 = [7 8 2 3 7 7 6 7]'
a3 = [9 2 3 3 4 3 7 4]'
The output shall be:
a1 = [3 3 5 6 6 6 9 9]'
a2 = [7 8 7 3 6 7 2 7]'
a3 = [4 2 4 3 7 9 3 3]'