Cody

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

Solution 131445

Submitted on 27 Aug 2012
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: Assertion failed. ```

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

``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```

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

``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```

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

``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```

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

``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```

6   Pass

``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```

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

``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```

8   Pass
``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```
``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```
``` Hessian = 0 0 0 0 [Warning: Function /users/msssystem19/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In Rosenbrock_banana at 8 In verifyCode>evaluateCode at 231 In verifyCode at 40 In fevalJSON at 14] ```