Re: NestWhile
- To: mathgroup at smc.vnet.net
- Subject: [mg37875] Re: NestWhile
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Sat, 16 Nov 2002 01:15:41 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <ar24f4$fpi$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, something like: f[{x_, _}] := {x^2 + 1, If[x < 10, True, False]} and NestWhile[f, {1, True}, Last] Regards Jens Hader Josef wrote: > > Hi folks, > maybe you can help me with the following problem: > > there is an iterative function > f[x_]:=.... resulting something like {values, boolean} > > I would like to nest f onto f repetitativly, however the number is not > fixed in the beginning, but depends on the output of f (the boolean > value). > it looks like: > NestWhile[f[#] &, {init,true}, criteria (depending on the output of f, 10] > > any hint??? > thank you > h.