MathGroup Archive 1998

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

Search the Archive

Re: Evaluation Control

  • To: mathgroup at
  • Subject: [mg14861] Re: [mg14858] Evaluation Control
  • From: steffenz at
  • Date: Mon, 23 Nov 1998 10:11:44 -0500
  • Sender: owner-wri-mathgroup at

> Date:          Fri, 20 Nov 1998 02:17:04 -0500
> From:          phantomlord at
> To:            mathgroup at
> Subject: [mg14861]       [mg14858] Evaluation Control
> Organization:  Deja News - The Leader in Internet Discussion

> I am writing a function which involves manipulation of lists, but have
> stumbled across a problem.  It seems as though when I call
> "Print[list[i]]" in a Do[] loop (where i is the iterative variable) it
> returns the following: {0.,.2,.4,.6,.8,1.}[i] i.e. it hasn't referenced
> the one element I require for computation in the rest of the code.
> I try to evaluate a function f[x] at x=list[i], which returns:
> Cosh[{0.,.2,.4,.6,.8,1.}[i.]]+....bla bla bla so it seems that it
> interprets i as a decimal and NOT an integer, is this the cause of the
> problem or is there something else I am doing wrong?
> Thanks
> Paul
> -----------== Posted via Deja News, The Discussion Network ==----------
>       Search, Read, Discuss, or Start Your Own

An Iterator needs doubled brackets like: list[[i]] 


  • Prev by Date: Re: Sqrt and Listability
  • Next by Date: Re: Mechanical Systems Question
  • Previous by thread: Re: Evaluation Control
  • Next by thread: Bug in NonlinearRegress on NDSolve