Which function should I use here to group my matrix?
Show older comments
Hello community,
Just an hour before, I asked a question, but I find out I was wrong with my interpretation and I apologise for it.
I like to ask again the modified question. I appreciate ,if you people could help me.
Here is my question.
if I have this matrix.
A = [1 0 0;
-2 0 0;
1.1 0 0;
-2.1 0 0;
1.2 0 0;
-2.2 0 0]
if i use here the sort function, I will get this
B = sort(A)
B = [-2.2 0 0;
-2.1 0 0;
2 0 0;
1 0 0;
1.1 0 0;
1.2 0 0].
and the answer I want is this,
B = [1 0 0;
1.1 0 0;
1.2 0 0;
-2 0 0;
-2.1 0 0;
-2.2 0 0].
What function should I use here? I believe this is something related to group or sorting function.
Thank you,
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!