help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: max index


From: Søren Hauberg
Subject: Re: max index
Date: Sun, 31 May 2009 18:23:36 +0200

søn, 31 05 2009 kl. 16:12 +0000, skrev Carlo Rossi:
> hello,
>  I need something like this:
> 
> A = [ 4; 20; 40; 0];
> 
>  maxIdx = find(  max( A ))
> 
> I need 3 as result
> but this above return 0!!!
> 
> How come, thanks,

You can do this in two ways:

  find (A == max (A))

or

  [val, idx] = max (A)

Søren



reply via email to

[Prev in Thread] Current Thread [Next in Thread]