sort the matrix according to order of column
1 view (last 30 days)
Show older comments
Let's say, I have the matrix:
A=[x,y]=[1.1 2;1.2 4;1 4;1.1 3 ;1.3 2;1.3 4;1 2;1.2 3;1.3 3;1.2 2;1 3;1.1 4];
As you observed that:the value of
1st column vary from 1 to 1.3
2nd colume vary from 2 to 4
How can I sort the matrix A to get the result as:
Result=[1 2
1.1 2
1.2 2
1.3 2
1.1 3
1.2 3
1.3 3
1.1 4
1.2 4
1.3 4]
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!