CAD/CAM技术及应用
if xOffset && ~isreal(x)
error('MATLAB:interp1:ComplexX','X should be a real vector.')
end
if ~ppOutput && ~isreal(xi)
error('MATLAB:interp1:ComplexInterpPts', ...
'The interpolation points XI should be real.')
end
% Error check for NaN values in X and Y
% check for NaN's
if xOffset && (any(isnan(xCol)))
error('MATLAB:interp1:NaNinX','NaN is not an appropriate value for X.');
end
% NANS are allowed as a value for F(X), since a function may be undefined
% for a given value.
if any(isnan(yMat(:)))
warning('MATLAB:interp1:NaNinY', ...
['NaN found in Y, interpolation at undefined values \n\t',...
' will result in undefined values.']);
end
if (n < 2)
if ppOutput || ~isempty(xi)
error('MATLAB:interp1:NotEnoughPts', ...
'There should be at least two data points.')
else
yi = zeros(siz_yi,superiorfloat(x,y,xi));
varargout{1} = yi;
return
end
end
% Process METHOD in
% PP = INTERP1(X,Y,METHOD,'pp')
% YI = INTERP1(Y,XI,METHOD,...)
% YI = INTERP1(X,Y,XI,METHOD,...)
% including explicit specification of the default by an empty input.
if ppOutput
if isempty(varargin{3})