Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7292
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: variable amount of Interpolation points |
| Date | 2011-12-17 07:41 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jchh35$iar$1@smc.vnet.net> (permalink) |
| 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@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!
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: variable amount of Interpolation points Bob Hanlon <hanlonr357@gmail.com> - 2011-12-17 07:41 +0000
csiph-web