comparison scripts/geometry/griddata.m @ 28216:f5644ccd1df5

griddata.m, griddatan.m: Small tweak in input validation. * griddata.m: Only call tolower on METHOD input when it is required. * griddatan.m: Only call tolower on METHOD input when it is required. Add note to documentation that query values outside the convex hull will return NaN.
author Rik <rik@octave.org>
date Mon, 13 Apr 2020 18:19:41 -0700
parents 0e0e0de09f1e
children 90fea9cc9caa
comparison
equal deleted inserted replaced
28215:ad71b30058ff 28216:f5644ccd1df5
127 method = varargin{3}; 127 method = varargin{3};
128 if (isempty (method)) 128 if (isempty (method))
129 method = "linear"; 129 method = "linear";
130 elseif (! ischar (method)) 130 elseif (! ischar (method))
131 error ("griddata: METHOD must be a string"); 131 error ("griddata: METHOD must be a string");
132 else
133 method = tolower (method);
132 endif 134 endif
133 method = tolower (method);
134 135
135 if (any (strcmp (method, {"linear", "nearest", "v4"}))) 136 if (any (strcmp (method, {"linear", "nearest", "v4"})))
136 ## Do nothing, these are implemented methods 137 ## Do nothing, these are implemented methods
137 elseif (any (strcmp (method, {"cubic", "natural"}))) 138 elseif (any (strcmp (method, {"cubic", "natural"})))
138 ## FIXME: implement missing interpolation methods. 139 ## FIXME: implement missing interpolation methods.