Re: Position of element in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg16359] Re: Position of element in a list
- From: dreiss at !SPAMscientificarts.com (David Reiss)
- Date: Thu, 11 Mar 1999 02:16:37 -0500
- Organization: EarthLink Network, Inc.
- References: <7bt665$ndn@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <7bt665$ndn at smc.vnet.net>, 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
In[1]:= Position[{-1, 3, -2, 1},_?Negative]
Out[1]={{1},{3}}
--
----------------------------------------
Scientific Arts:
Creative Services and Consultation
for the Applied and Pure Sciences
http://www.scientificarts.com
David Reiss
Email: dreiss at !SPAMscientificarts.com
----------------------------------------
Remove the !SPAM to send email