order matrix

Hi, I am a student and I want to sort the rows of an matrix based on the ascending criteria of a column.

Matrix M = [5,3,5; 2,7,1; 3,2,4] I would like to sort it by rows according to the ascending number of the third column. The result I want to get is R = [2,7,1; 3,2,4; 5.3.5]
What instructions should I execute?

Scilab 14-12-20, 7:16 p.m. oepbefem
The command "gsort" can do it very easily. Explore the "method" and "direction" options passed to the "gsort" command.
24-12-20, 3:25 p.m. rupakrokade

Log-in to answer to this question.