

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


The command "gsort" can do it very easily. Explore the "method" and "direction" options passed to the "gsort" command.
Login to add comment