"Extrapolation gives wrong values when using interp1"
interp1 is giving the right value.
The problem is simple: the last two points have the same Y value, so any linear extrapolation will simply continue with that value. Linear interpolation/extrapolation of a new point takes into account (at most) only two data points, which means that the overall downward trend of your data is irrelevant, because the last two points are these:
So all larger X values will simply return Y = 1.091, no matter how large you make X.
To resolve this you might want to add some smoothing, or do some subsampling, or fit a line (e.g. using least squares), or merge points that are close together, or ... whatever makes sense for your data.
Best Answer