Re: NestWhile
- To: mathgroup at smc.vnet.net
- Subject: [mg37872] Re: NestWhile
- From: "Borut L" <gollum at email.si>
- Date: Sat, 16 Nov 2002 01:15:35 -0500 (EST)
- References: <ar24f4$fpi$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, NestWhile is maybe the right function, but your problem seems a little weird to me. Like something is being too much. If you had just described it a little bolder. Hope that helps a little: f[x_]:=If[x\[LessEqual]100,{x+15,True},{x+1,False}] NestWhileList[f@First[#]&,{0,True},Last@#\[Equal]True&] "Hader Josef" <e9426270 at stud4.tuwien.ac.at> wrote in message news:ar24f4$fpi$1 at smc.vnet.net... | 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. | | | |