Re: Interpolation difficulty
- To: mathgroup at smc.vnet.net
- Subject: [mg116569] Re: Interpolation difficulty
- From: Ray Koopman <koopman at sfu.ca>
- Date: Sun, 20 Feb 2011 05:25:26 -0500 (EST)
- References: <ijo544$lep$1@smc.vnet.net>
On Feb 19, 2:13 am, Javier <mathquesti... at gmail.com> wrote:
> Interpolation[{{2, 1}, {4, 5}, {5, 2}}, InterpolationOrder -> 0]
> gives a function which is 5 from 2 to 4, and 2 from 4 to 5.
>
> I want as a result a function which is 1 from 2 up to 4, then
> 5 from 4 up to 5. It should extrapolate to x=1 giving also 1,
> and to x=6 giving 2. Is this possible? Many thanks in advance.
See the documentation for InterpolationOrder:
http://reference.wolfram.com/mathematica/ref/InterpolationOrder.html
It sounds like you were expecting Interpolation to interpret
InterpolationOrder->0 the same way that ListLinePlot does.
Also note that, when InterpolationOrder->0, the function returned
by Interpolation disagrees with the data at the first data point.