MathGroup Archive 2003

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

Search the Archive

Re: List manipulation


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