% banana.m  -  Rosenbrock banana function for M604 HW02
%
% Input parameter xy must be a column vector with two components.
function z = banana(xy)

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

z = 1 + 100*(x*x-y)^2 + (x-1)^2;

