% bananad.m  -  Rosenbrock banana function gradient for M604 HW02
%
% Input parameter xy must be a column vector with two components.
% Output is a row vector of length 2.

function z = bananad(xy)

z = zeros(1,2);

x = xy(1);
y = xy(2);

z = [400*x^3-400*x*y+2*x-2,  200*(y-x^2)];

