From: Sadik on 19 Feb 2010 20:38 How about this? Let your array be x. [sortedX,sortingIndices] = sort(x,'descend'); % sortedX will be in descending order. Therefore, the first N elements will be the N maximum values. maxValues = sortedX(1:N); maxValueIndices = sortingIndices(1:N); Best. "Athanasios " <athanasios_f(a)yahoo.gr> wrote in message <hlmlog$1re$1(a)fred.mathworks.com>... > I have an array with M values and i want to find the N maximum values as well their indices..Any help?
First
|
Prev
|
Pages: 1 2 Prev: PDE Toolbox, partial profiles of solution Next: Removing a row from a matrix |