e.g.
data = {{x1,y1}.......{xn,yn}};
int = Interpolate[data];
t1=Table[int[x],{x, xi, xf, dx}]
with xn != xf.
When xn != xf, Mathematica correctly points out that the point xf lies
outside the data range of the Interpolating function and proceeds to
extrapolate. How do I stop it from extrapolating.
Thanks
Yas
don't ask for values outside of the interval ?
> data = {{x1,y1}.......{xn,yn}};
> int = Interpolate[data];
> t1=Table[int[x],{x, xi, xn, dx}]
>
what else should Mathematica do ? use the periodic
values f[x1+Mod[(x-x1),(xn-x1)]]
return Infinity so that the function can't be plotted ?
Regards
Jens
In[1]:=
t[x_] := int[x] /; 1 <= x <= 10;
t[x_] := 0 /; x < 1 || x > 10;
and use it instead of int. It will give you 0 whenever you're outside the
interpolation range. BTW, the name is "Interpolation", not "Interpolate".
Tomas Garza
Mexico City