MathGroup Archive 2010

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

Search the Archive

simple nest


Dear group:
I have a function that gets five arguments, two of which are fixed, and three vary. Its output are three numbers. So it can be nested, for example over some initial values.
Say:
Nest[func[arg1,arg2,#[[1]],#[[2]],#[[3]]]&,{init1,init2,init3},k]
 
Simple enough, works well.
Now I want to nest the same function, while the second non fixed argument changes at each step. I thought the "natural" way of doing this was:
NestWhile[func[arg1,arg2,#[[1]],#[[2]],#[[3]]]&,{init1,init2,init3},UnsameQ[#[[2]]&,2],
but this evidently does not work.
 
So: in a NestWhile how do I create tests over parts of the outputs of a function?
Thanks!
Fg      


  • Prev by Date: Re: Initialization problem in a DynamicModule
  • Next by Date: Re: Replace list element based on a condition how to
  • Previous by thread: Re: Newbie to Mathematica - how do you read in an array of subscripted variables?
  • Next by thread: Re: simple nest