MathGroup Archive 1999

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

Search the Archive

Re: Position of element in a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16347] Re: [mg16301] Position of element in a list
  • From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
  • Date: Thu, 11 Mar 1999 02:16:31 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

In[16]:=
Position[{-1, 3, -2, 1},x_?Negative]
Out[16]=
{{1}, {3}}

or

In[19]:=
Position[{-1, 3, -2, 1},x_/;x<0]
Out[19]=
{{1}, {3}}

On Sun, Mar 7, 1999, Roger Mason <rmason at sparky2.esd.mun.ca> wrote:

>Hi,
>
>I want to find the Position[] of negative elements in a list. The obvious
>methods do not work:
>
>Position[{-1, 3, -2, 1}, -_]
>
>and
>
>Position[{-1, 3, -2, 1}, -x_]
>
>return
>
>{}
>
>So how do I perform this apparently simple task?
>
>Thanks,
>
>Roger Mason
>


Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp/
http://eri2.tuins.ac.jp/



  • Prev by Date: Graphics Packages Facilitating Combination of Plots
  • Next by Date: RE: Position of element in a list
  • Previous by thread: Re: Position of element in a list
  • Next by thread: RE: Position of element in a list