MathGroup Archive 1999

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

Search the Archive

Re: List Position


Harry flynn wrote in message <79eagc$9ig at smc.vnet.net>...
>Can anyone tell me how I find the position in a list of the first value
>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 advance.
>Harry.


It sure is ugly, but it works.

lst={{1},{1},{2},{8},{-3}};

Position[lst,Select[Flatten[lst],#<=0&]]//Flatten//First

I am looking forward to see some more elegant solutions.

Martin.



  • Prev by Date: Re: BracketingBar for output
  • Next by Date: Re: Q: how to list vertices of the Geodesate[] of a polyhedron?
  • Previous by thread: Re: List Position
  • Next by thread: Re: List Position