Cody

# Problem 481. Rosenbrock's Banana Function and its derivatives

Solution 2894864

Submitted on 31 Aug 2020 by Schiefermüller Lukas
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass

2   Pass
x = [0; 0]; assert(isequal(Rosenbrock_banana(x),1))

value = 1 gradient = -2 0 Hessian = 2 0 0 200

3   Pass
x = [1; 1]; assert(isequal(Rosenbrock_banana(x),0))

value = 0 gradient = 0 0 Hessian = 802 -400 -400 200

4   Pass
x = [1; -1]; assert(isequal(Rosenbrock_banana(x),400))

value = 400 gradient = 800 -400 Hessian = 1602 -400 -400 200

5   Pass
x = [-1; 0.5]; assert(isequal(Rosenbrock_banana(x),29))

value = 29 gradient = -204 -100 Hessian = 1002 400 400 200

6   Pass

value = 1 gradient = -2 0 Hessian = 2 0 0 200

7   Pass
x = [0; 0]; [~,~,Hess]=Rosenbrock_banana(x); assert(isequal(Hess,diag([2, 200])))

value = 1 gradient = -2 0 Hessian = 2 0 0 200

8   Pass

value = 0 gradient = 0 0 Hessian = 802 -400 -400 200

9   Pass
x = [1; 1]; [~,~,Hess]=Rosenbrock_banana(x); assert(isequal(Hess,[802, -400; -400, 200]))

value = 0 gradient = 0 0 Hessian = 802 -400 -400 200

10   Pass