1 function g = extended_rosenbrock_gradient1(x)
3 % The gradient of the extended Rosenbrock function. See
4 % extended_rosenbrock1.m for more information.
6 % Since the number of arguments is variable, we take a vector
7 % instead of its individual components.
12 % 'm' below must be an integer.
20 % The extended Rosenbrock is simply a sum of Rosenbrock
26 g_k = rosenbrock_gradient(y1, y2);
28 g(2*k - 1) = g(2*k - 1) + g_k(1);
29 g(2*k) = g(2*k) + g_k(2);