]> gitweb.michael.orlitzky.com - octave.git/blob - optimization/test_functions/himmelblau_gradient.m
b50e7b6265879d06677b64259ad2912bb88a8eef
[octave.git] / optimization / test_functions / himmelblau_gradient.m
1 function g = himmelblau_gradient(x1,x2)
2 ##
3 ## The gradient of the Himmelblau function. See himmelblau.m for
4 ## more information.
5 ##
6 f_x1 = 4*(x1^2 + x2 - 11)*x1 + 2*x2^2 + 2*x1 - 14;
7 f_x2 = 4*(x2^2 + x1 - 7)*x2 + 2*x1^2 + 2*x2 - 22;
8 g = [f_x1; f_x2];
9 end