| Author |
Comment/Response |
Gopinath Venkatesan
|
06/26/08 3:16pm
Dami
I don't know if this is what you are looking for.
xpoints = {1, 2, 3, 4};
ypoints = {1, 2, 3, 4};
funval = {{1, 2, 3, 4}, {2, 2, 6, 4}, {3, 6, 3, 4}, {4, 4, 12, 4}};
gridxy = {xpoints, ypoints};
intpfun[x_, y_] := ListInterpolation[funval, gridxy][x, y];
intpfun[2.5, 2.5]
Plot3D[intpfun[x, y], {x, 1, 4}, {y, 1, 4}]
The above intpfun[2.5,2.5] gives 4.23 which is different from your previous value (3.95).
By setting order of interpolation in the ListInterpolation, i.e., intpfun[x_, y_] := ListInterpolation[funval, gridxy,InterpolationOrder->{2,2}][x, y];
you can get 3.5.
Hope it helps.
Gopinath
URL: , |
|