MATLAB: How to sort one column of a matrix sort I have a matrix that has 500 rows and 5 columns. I want to sort the matrix based on the 3 rd column. I mean rearrange the matrix based on the 3rd column descending. Best Answer B = sortrows(A,-3) Related SolutionsMATLAB: Sorting the elements of a matrix, Part 3 If you want the sorting on 2x2 sub-matrices, create 2x2 sub-matrices at first:AA = reshape(A, 2, 2, 2);BB = sort(AA, 2, 'descend');B = reshape(BB, 2, 4) MATLAB: How can i sort all the rows of a matrix but one along a row b=[a(:,1),sortrows(a(:,2:end),4,'descend')]; Related QuestionSorting matrixMulti-Column Ordering of Matrices in Different Orders
Best Answer