Cody

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

Solution 78125

Submitted on 18 Apr 2012 by Zachary Sylvester
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))

``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 2 0 0 200 ```

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

``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 802 -400 -400 200 ```

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

``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 1602 -400 -400 200 ```

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

``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 1002 400 400 200 ```

6   Pass

``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 2 0 0 200 ```

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

``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 2 0 0 200 ```

8   Pass
``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 802 -400 -400 200 ```
``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 802 -400 -400 200 ```
``` RB = @(z)100*((z(2)-z(1)^2)^2)+(1-z(1))^2 Hessian = 3534 760 760 200 ```