MathGroup Archive 2001

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

Search the Archive

Re: Local iterator

  • To: mathgroup at
  • Subject: [mg29384] Re: [mg29361] Local iterator
  • From: BobHanlon at
  • Date: Sat, 16 Jun 2001 02:47:55 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 2001/6/15 2:39:43 AM, vvasta at writes:

>I would like to write a function like Table, or Do, that takes an iterator
>and invokes a specified function for each value in the iterator interval,
>could write something working without iterator:
>myfun[fun_, it_, vmin_, vmax_] := Block[{it},
>    For[it = vmin, it <= vmax, ++it, Print[fun]]
>    ]
>How can I write a function like myfun[f,{i,mix,max,step}] ?

What exactly do you want the function to do that cannot be done directly with 

Table[Log[x], {x, 1., 9., 2.}]//TableForm

Table[{x, N[Log[x]]}, {x, 1, 9, 2}]//TableForm

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: roots
  • Next by Date: Re: Can Mathematica evaluate step by step
  • Previous by thread: Local iterator
  • Next by thread: Re: Local iterator