function y = rsnbrck(x) % function y = rsnbrck(x) % Rosenbrock function. x is vector of length 2. y = (1-x(1))^2 +105*(x(2)-x(1)^2)^4;