MATLAB: How to select highest three maximum values from each row of an matrix matrix A=rand(3,8) generates a matrix of 3 rows with 8 columns could anyone help me how to select highest three maximum values from each row. Best Answer A=rand(3,8);B = sort(A,2,'descend');out = B(:,1:3); Related SolutionsMATLAB: How to select the top 5 five values in a matrix maxk(A(:),5) % gives the max 5 values of entire matrix%or max(A,[],2) % gives max of each row (finally resulting with 5 values) MATLAB: Highest frequency Please try the mode function: x = mode(A);HTH. Related QuestionSelecting the highest valueLocation of 10 highest valuesFinding highest values in string
Best Answer