MathGroup Archive 2003

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

Search the Archive

Re: List manipulation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44579] Re: [mg44554] List manipulation
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Sat, 15 Nov 2003 02:05:08 -0500 (EST)
  • References: <200311140658.BAA01397@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Nov 14, 2003, at 1:58 AM, Miguel Cruz wrote:

>
> Good day all,
> I have a For loop storing data in a {x,y} list (where x is time and y 
> is
> temperature), and I would like to get the x at which a certain 
> threshold
> y occurs without stoping the loop.
> Any hints?
> Thanks!
> Miguel
>

You can use Sow and Reap to record the {x,y} pair that meets your 
criteria.

For example,

Reap[Table[If[i>10,Sow[i],i],{i,12}]]

Returns

{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, {{11, 12}}}

Regards,

Ssezi


  • Prev by Date: Re: Defining function
  • Next by Date: Re: Trigonometric math functions
  • Previous by thread: List manipulation
  • Next by thread: RE: List manipulation