MATLAB: How to know the indices of multiple max values arrayindicesMATLABmultiple max hi there! I'm having problem about identifying the indices(position) of a multiple max values. example of input: A=[4 5 9 9] how can i know the indices of those 9's? Best Answer One way:A = [4 5 9 9];maxval = max(A);lia = ismember(A,maxval);idx = find(lia);or shortermaxval = max(A);idx = find(A == maxval); Related SolutionsMATLAB: How to extract two equal maximum values at different index index=find(A==max(A))This should give you the indexes. MATLAB: How to look for minimum value in a vector from backwards A = [5 6 4 1 1 1];A_min = min(A);idx = find(A == A_min,1,'last')Also[A_min,idx] = min(fliplr(A));idx = numel(A) - idx + 1 Related QuestionHow to find multiple maximum values and they are indexes of 4-D arrayHow to know the location of maximum value in a vectorHow to find row valuesTo get the column number of max and min numberExtract Imadjust valuesReturn Indices for x Smallest/Largest Values in Array
Best Answer