sort 3 column matrix by two key words
    6 views (last 30 days)
  
       Show older comments
    
how to do this in matlab? sort the matrix raws first by the first column, then by the second column?
input = [
1  2  11
1  2  11
1  2  12
1  2  11
1  2  11
1  2  12
1  3  17
1  3  15
1  4  18
1  4  18
1  3  15
1  3  16
2  3  17
2  3  15
1  3  16
1  3  17
1  3  15
1  3  15
1  3  15
1  3  16
1  2  12
1  2  11
1  2  11
1  2  11
1  4  18
1  4  18
1  4  18
2  4  17
2  4  17
1  4  17
1  4  17
1  4  17
]
output = [1  2  11
1  2  11
1  2  12
1  2  11
1  2  11
1  2  12
1  2  12
1  2  11
1  2  11
1  2  11
1  3  17
1  3  15
1  3  15
1  3  16
1  3  16
1  3  17
1  3  15
1  3  15
1  3  15
1  3  16
1  4  18
1  4  18
1  4  18
1  4  18
1  4  18
1  4  17
1  4  17
1  4  17
2  3  17
2  3  15
2  4  17
2  4  17
]
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
				Find more on Shifting and Sorting Matrices in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
