Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: List Position

  • To: mathgroup at
  • Subject: [mg15815] Re: List Position
  • From: JOERG SCHLICHTMANN <joerg.schlichtmann at>
  • Date: Mon, 8 Feb 1999 03:25:41 -0500 (EST)
  • Organization: Ruhr-Universitaet Bochum, Rechenzentrum
  • References: <79eagc$>
  • Sender: owner-wri-mathgroup at

Harry flynn schrieb:
> Can anyone tell me how I find the position in a list of the first
> less than or equal to zero.
> For example, how can I get Mathematica to tell me that in the list
> {{1},{1},{2},{8},{-3}}
> that the first value of interest to me is position 5. Thanks in
> Harry.

What about this:

e.g. the list l:


finding the element {-3} functions as follows:

  If[l[[i,1]]<=0,{Print[l[[i]]," at Position ", i],i=Length[l]+1},i++]]



  • Prev by Date: Re: Using Mathem.. to learn calculus? or Statistics?
  • Next by Date: Re: Finding real part (newbie question)
  • Previous by thread: Re: List Position
  • Next by thread: Re: List Position