[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Finding the index of the smallest value in a vector
From: |
Henry F. Mollet |
Subject: |
Re: Finding the index of the smallest value in a vector |
Date: |
Thu, 18 Nov 2004 10:51:34 -0800 |
User-agent: |
Microsoft-Entourage/10.1.1.2418 |
octave:1> x=rand (1,5)
x =
0.287022 0.852619 0.072704 0.766768 0.837517
octave:2> min(x)
ans = 0.072704
octave:3> imin = find (x==min(x))
imin = 3
Henry
on 11/18/04 12:16 AM, Ploett Norbert at address@hidden wrote:
> Hello all,
>
> I need to find a function that returns the index of the smallest value in a
> vector. How do I go about this? I.e. is there a handy function that I do not
> know of?
>
> find() does not seem to do exactly what I want.
>
> Tnx,
>
>
> Norbert
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
>
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------