]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/test_functions/wood1.m
Add length checks to the wood functions, and fix wood_hessian1().
[octave.git] / optimization / test_functions / wood1.m
index 6c3f31901f542bcb2d827fe98c641ef80d29dcca..c34de26a9dfe738f59f595b5a5f3731cef472f32 100644 (file)
@@ -4,5 +4,9 @@ function f = wood1(x)
   ## instead of four distinct arguments. See wood.m for more
   ## information.
   ##
-  f = wood(x(1), x(2), x(3), x(4));
+  if (length(x) == 4)
+    f = wood(x(1), x(2), x(3), x(4));
+  else
+    f = NA;
+  end
 end