MATLAB: How to sort first column of matrix of numbers by shifting the rows

excelrowssort

I have a 3 column matrix with numerous rows. The data, x,y,z in each row must be preserved. I want to sort the rows in asserding order of x by changing the row position, this is row 5 may become row 1 if x(5) is the minimum. This type of sort is done in EXCEl. What is an equivalent sort in Matlab.

Best Answer

Use sortrows.