MathGroup Archive 2002

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

Search the Archive

Re: Extraction of positive values from list of both +/- values

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34646] Re: Extraction of positive values from list of both +/- values
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Fri, 31 May 2002 04:26:22 -0400 (EDT)
  • References: <ad4je4$jlu$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Oscar,

    lstvals={700, 600, 500, 400, 300, 200, 100, -50, 100, -200, -300};

    Select[lstvals, Positive]

        {700,600,500,400,300,200,100,100}

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565


"O.A. Linares, M.D., Ph.D." <divinesaam at aol.com> wrote in message
news:ad4je4$jlu$1 at smc.vnet.net...
> Dear Colleagues,
>
> I have a list of values:
>
> lstvals={700, 600, 500, 400, 300, 200, 100, -50, 100, -200, -300}
>
> I want to create a list that contains only the positive values. I know I
can use
>
> lst=Take[lstvals, 7]
>
> The problem is, the size of the vectors vary. Help appreciated.
>
> Thanks,
>
> Oscar
>




  • Prev by Date: Re: Function as an argument of the function
  • Next by Date: Re: Function as an argument of the function
  • Previous by thread: RE: Extraction of positive values from list of both +/- values
  • Next by thread: RE: Extraction of positive values from list of both +/- values