X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=optimization%2Ftest_functions%2Frosenbrock_gradient1.m;fp=optimization%2Ftest_functions%2Frosenbrock_gradient1.m;h=e8a83b6c34a878badc6cea642f26bc09219eb480;hp=0000000000000000000000000000000000000000;hb=75563505172dce2cc78116f0884819ca32620dbe;hpb=1e0c72bb336872f0839305340eb9699a87a40319 diff --git a/optimization/test_functions/rosenbrock_gradient1.m b/optimization/test_functions/rosenbrock_gradient1.m new file mode 100644 index 0000000..e8a83b6 --- /dev/null +++ b/optimization/test_functions/rosenbrock_gradient1.m @@ -0,0 +1,12 @@ +function g = rosenbrock_gradient1(x) + ## + ## A version of the rosenbrock_gradient() function which takes a + ## column 2-vector instead of two distinct arguments. See + ## rosenbrock_gradient.m for more information. + ## + if (length(x) == 2) + g = rosenbrock_gradient(x(1), x(2)); + else + g = NA; + end +end