MATLAB: How to select the top 5 five values in a matrix array If A=rand(5,15) whch generates 5 rows with 15 columns Could anyone help me how to select the highest 5 values in A. Best Answer 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) Related SolutionsMATLAB: How to select highest three maximum values from each row of an matrix A=rand(3,8);B = sort(A,2,'descend');out = B(:,1:3); MATLAB: Draw a five star Read about plot. A = [ 6.5, 0 9, 5, 14, 5.5, 10.5, 9, 12, 14, 6.5, 11.5, 2, 14, 3.5, 9, 0, 5.5 ,5, 5 6.5, 0 ] ; plot(A(:,1),A(:,2))If you want color use:patch(A(:,1),A(:,2),'r') Related QuestionHow to pick five data points equally above and below ( five above and five below)Five plots in one figureFind maximum value of each row in a double matrixHow to find the maximum of a given matrix and then locate the minimum value along the row of the maximum valueFitting a function of five varaibles!
Best Answer