Yes, well that would be the issue for a matrix, but the OP stated they were trying to sort a vector. To sort each independent vector of a matrix would be possible using multiple calls to sortn, but really, it's not the question at hand.
... View more