MathGroup Archive 2011

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

Search the Archive

Re: variable amount of Interpolation points

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123733] Re: variable amount of Interpolation points
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Sat, 17 Dec 2011 02:40:15 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201112161053.FAA06964@smc.vnet.net>

>From the documentation for For: "Unless an explicit Return is used,
the value returned by For is Null."

{For[i=0,i<4,i++,{i,2 i}]}

{Null}

For[i=0;list={},i<4,i++,AppendTo[list,{i,2 i}]];list

{{0,0},{1,2},{2,4},{3,6}}

Interpolation[For[i=0;list={},i<4,i++,AppendTo[list,{i,2 i}]];list]

InterpolatingFunction[{{0,3}},<>]

Table would be much simpler

Interpolation[Table[{i,2i},{i,0,3}]]

InterpolatingFunction[{{0,3}},<>]

%==%%

True


Bob Hanlon

On Fri, Dec 16, 2011 at 5:53 AM, Konny
<konstantinweixelbaum at googlemail.com> wrote:
> Is there a way to iterate inside an interpolation??
>
> I am thinking to make the amount of interpolation points variable.
>
> I tried this, but had no luck
>
> Interpolation[{For[i = 0, i < 4, i++, {i, 2 i}]}]
>
> Thanks in advance for any help!
>



  • Prev by Date: Re: variable amount of Interpolation points
  • Next by Date: Re: Span Set nasty bug
  • Previous by thread: variable amount of Interpolation points
  • Next by thread: Re: variable amount of Interpolation points