MATLAB: How to arrange ascending order only one column of a matrix

arrayascendingmatrix

Let's say, I have a=[25 10 85 35 71; 1 2 3 4 5] and output shout come b=[10 25 35 71 85; 2 1 4 5 3]

Best Answer

b=sortrows(a.').'