MATLAB: Sort a Matrix based on a column sort I want to sort a matrix. Actually I want to sort the last column and all the rest columns based on the last. Has anyone idea about this??? Best Answer [lastvals, idx] = sort(A(:,end));sortedA = A(idx,:); Related SolutionsMATLAB: Sorting Use the sortrows() function instead. MATLAB: How to sort one column of a matrix B = sortrows(A,-3) Related QuestionSortingHow to sort the data with respect to a column in matlab
Best Answer