MATLAB: Sort rows of a matrix based on their maximum value MATLABsort Hello, Consider a 100×10 matrix. Each 1×10 row has a maximum value. How can I sort the rows of the matrix in ascending order based only on their maximum value? Thank you very much. Best, Pavlos Best Answer A = rand(100, 10);maxA = max(A, [], 2);[dummy, index] = sort(maxA);B = A(index, :); Related SolutionsMATLAB: Extracting an element in a vector [~,ii] = max(A);[~,ii(2)] = min(A);out = A(setdiff(1:numel(A),ii));other way[~,ii] = sort(A);out = A(sort(ii(2:end-1)));more wayout = A(A ~= max(A) & A ~= min(A)); MATLAB: Finding minimum values in a matrix of array nx1 Use sort functiona=sort(A)out=a(1:10) Related QuestionHow to detect index of the max amplitudeRepeated values in a column of a matrixI have a problemKeep only certain rows (with minimum values) from a matrixHow to retain only the rows of a matrix based on the unique numbers in the first column of the matrixMax function to receive maximum element of the row
Best Answer