Assume matrix A as follows:
A = [1 1 201 2 321 3 102 1 452 2 102 3 153 1 433 2 90];
I want to sort matrix A based on the third column. However, I want to keep the first column also sorted. Whenever the ID changed, then column 3 is sorted. The output should be something likes:
B = [1 3 101 1 201 2 322 2 102 3 152 1 453 1 433 2 90];
Best Answer