title: Matlab multidimensional extrapolation
body: <p>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 &quot;makima&quot; or &quot;spline&quot;. However, when linear interpolation is used, the command can only return a prespecified single extrapolation point.</p>
  <p>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.</p>