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