index n's maximun values in an array

index n's maximun values in an array

Post by Jessic » Sat, 27 Sep 2008 09:51:02


Hi.

I want to index for example de 4 maximun values in an array. For example

f= [3 5 9 7 8 9 0 1]
index = [3 4 5 6]

thanks.
 
 
 

index n's maximun values in an array

Post by John D'Err » Sat, 27 Sep 2008 10:01:03


What would happen if you sort the array?

Look at the outputs of sort.

John

 
 
 

index n's maximun values in an array

Post by Jessic » Sat, 27 Sep 2008 10:41:02

[A index] = sort(g,'descend');

That's how i wanted it, thanks