I have a 6 dimensional grid. I use interpn command in Matlab to find interpolated points between grid values. However, sometimes I need to evaluate points outside the grid. The interpn command does this automatically if the method is set to "makima" or "spline". However, when linear interpolation is used, the command can only return a prespecified single extrapolation point.
Is there some other command I could use for linear extrapolation outside the grid? This could be done for example by fitting a line between the nearest points on the grid.