I receive an error when I call INTERP2 with 4 inputs as shown below:
Z = rand(10,10);x = 12; y = 5; interp2(Z,x,y,'*linear')
Note that the values of "x" and "y" cause the function to extrapolate. The error occurs only when extrapolating. The following error occurs:
??? Input argument "ExtrapVal" is undefined. Error in ==> interp2>nearest at 584 if any(vout(:)), F(vout) = ExtrapVal; end Error in ==> interp2 at 98 zi = nearest(varargin{1:end-index}, ExtrapVal);
Best Answer