MATLAB: Does “sortrows” not work with a semicolon

output suppressionsortrows

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

Best Answer

Remember, sortrows(P,-1); would sort the rows and then would throw away the results because you did not write them to a variable.