Which function should I use here to group my matrix?
Afficher commentaires plus anciens
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,
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!