comparison scripts/geometry/griddatan.m @ 28213:bb50407f9c60

griddatan.m: Issue informational error if "cubic" METHOD is used. * griddatan.m: Issue error that "cubic" method is not yet implemented. Adjust BIST tests for new behavior.
author Rik <rik@octave.org>
date Mon, 13 Apr 2020 08:56:13 -0700
parents 289882040316
children f5644ccd1df5
comparison
equal deleted inserted replaced
28212:d052c11d47c6 28213:bb50407f9c60
106 endif 106 endif
107 107
108 method = tolower (method); 108 method = tolower (method);
109 if (strcmp (method, "linear") || strcmp (method, "nearest")) 109 if (strcmp (method, "linear") || strcmp (method, "nearest"))
110 ## Do nothing, these are implemented methods 110 ## Do nothing, these are implemented methods
111 elseif (any (strcmp (method, {"cubic", "v4"}))) 111 elseif (strcmp (method, "v4"))
112 error ('griddatan: "%s" METHOD is available for 2-D inputs by using "griddata"', method); 112 error ('griddatan: "%s" METHOD is available for 2-D inputs by using "griddata"', method);
113 113
114 elseif (strcmp (method, "natural")) 114 elseif (any (strcmp (method, {"cubic", "natural"})))
115 ## FIXME: Remove when griddata.m supports "natural" method. 115 ## FIXME: Remove when griddata.m supports these methods.
116 error ('griddatan: "natural" interpolation METHOD not yet implemented'); 116 error ('griddatan: "%s" interpolation METHOD not yet implemented', method);
117 117
118 else 118 else
119 error ('griddatan: unknown interpolation METHOD: "%s"', method); 119 error ('griddatan: unknown interpolation METHOD: "%s"', method);
120 endif 120 endif
121 121
189 %!error <Y must be a column vector> griddatan ([1;2],[3,4], 1) 189 %!error <Y must be a column vector> griddatan ([1;2],[3,4], 1)
190 %!error <Y must .* same number of points .* as X> griddatan ([1;2],[3;4;5], 1) 190 %!error <Y must .* same number of points .* as X> griddatan ([1;2],[3;4;5], 1)
191 %!error <dimension of .* XI .* must match X> griddatan ([1;2],[3;4], [1, 2]) 191 %!error <dimension of .* XI .* must match X> griddatan ([1;2],[3;4], [1, 2])
192 %!error <METHOD must be a string> griddatan ([1;2],[3;4], 1, 5) 192 %!error <METHOD must be a string> griddatan ([1;2],[3;4], 1, 5)
193 %!error <"v4" METHOD is available for 2-D> griddatan ([1;2],[3;4], 1, "v4") 193 %!error <"v4" METHOD is available for 2-D> griddatan ([1;2],[3;4], 1, "v4")
194 %!error <"cubic" METHOD is available> griddatan ([1;2],[3;4], 1, "cubic") 194 %!error <"cubic" .* not yet implemented> griddatan ([1;2],[3;4], 1, "cubic")
195 %!error <"natural" .* not yet implemented> griddatan ([1;2],[3;4], 1, "natural") 195 %!error <"natural" .* not yet implemented> griddatan ([1;2],[3;4], 1, "natural")
196 %!error <unknown .* METHOD: "foobar"> griddatan ([1;2],[3;4], 1, "foobar") 196 %!error <unknown .* METHOD: "foobar"> griddatan ([1;2],[3;4], 1, "foobar")