]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/test_functions/wood1.m
COPYING,LICENSE: add (AGPL-3.0+)
[octave.git] / optimization / test_functions / wood1.m
index 6c3f31901f542bcb2d827fe98c641ef80d29dcca..c0bfa201df4edded6be7e3e21c0598d523dd8056 100644 (file)
@@ -1,8 +1,12 @@
 function f = wood1(x)
-  ##
-  ## A version of the Wood function which takes a column 4-vector
-  ## instead of four distinct arguments. See wood.m for more
-  ## information.
-  ##
-  f = wood(x(1), x(2), x(3), x(4));
+  %
+  % A version of the Wood function which takes a column 4-vector
+  % instead of four distinct arguments. See wood.m for more
+  % information.
+  %
+  if (length(x) == 4)
+    f = wood(x(1), x(2), x(3), x(4));
+  else
+    f = NA;
+  end
 end