From: Sadik on
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?