Does "sortrows" not work with a semicolon?
Show older comments
Could someone clarify this issue I am having?
I tried to sort the rows of a matrix by the first column (in descending order)...
sortrows(P, -1) % works fine
But, for some reason:
sortrows(P, -1); % does not work!
Is this a known issue?
D Howard
Accepted Answer
More Answers (1)
Kevin Holst
on 21 Feb 2012
Works fine for me. I did this:
a = magic(5);
b = sortrows(a,-1);
When you say, does not work, do you mean it gives you an error, or it does not sort properly?
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!