Inconsistent results from cubic interpolation

1 view (last 30 days)
I'm getting funny output from 'griddata' when using Cubic interpolation technique. I suspect that this is due to the fairly large input coordinates, but I would like to dig to the bottom of this.
Attached file can be used to demonstrate the problem. All I do there is initialize a set of points, and find the interpolated z-value of a single point.
when using the original coordinates, the ouput is
-4.4466e+05
Now, when i use the same set of points, but moved to be closer to the origin (coordinates of magnitude of tens of thousands rather than billions), the output becomes
-5.9712e+03
(Or other values, depending on exactly how far the points are moved) The output of the second run is definitely (more) correct than the first one (which is a much lower value than any of the input points!).
Does anyone know what causes this behavior? It only happens for cubic interpolation, all other methods give consistent results.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!