Cody

Problem 481. Rosenbrock's Banana Function and its derivatives

Solution 2012852

Submitted on 10 Nov 2019
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   Fail

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

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

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

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

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

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

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

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

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

6   Fail

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

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

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

8   Fail

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

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

Error in solution: Line: 2 Column: 1 Function definition not supported in this context. Create functions in code file.

10   Fail