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: [mg16360] Re: [mg16301] Position of element in a list
  • From: "Martin W. Mak" <mwmak at ix.netcom.com>
  • Date: Thu, 11 Mar 1999 02:16:37 -0500
  • Organization: Harmonic Systems
  • References: <199903070605.BAA23750@smc.vnet.net.>
  • Sender: owner-wri-mathgroup at wolfram.com

Roger,

    You might try:

            Position[Negative /@ {-1,3,-2,1},True]//Flatten

Roger Mason 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





  • Prev by Date: Re: Multiplying a constant to a matrix column
  • Next by Date: Re: a tricky List manipulation problem
  • Previous by thread: Position of element in a list
  • Next by thread: Re: Position of element in a list