Cody

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

Solution 2909344

Submitted on 4 Sep 2020
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))

Hessian = 0 0 0 0

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

Hessian = 0 0 0 0

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

Hessian = 0 0 0 0

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

Hessian = 0 0 0 0

6   Fail

Hessian = 0 0 0 0

Assertion failed.

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

Hessian = 0 0 0 0

Assertion failed.

8   Pass

Hessian = 0 0 0 0

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

Hessian = 0 0 0 0

Assertion failed.

10   Fail

Hessian = 0 0 0 0

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!