% Rosenbrockfunktion

clear;
[x,y]=meshgrid(-2:0.1:2);
z=(1-x).^2+100.*(y-x.^2).^2;
figure;
mesh(x,y,z);
title('f2(x,y) mesh');
xlabel('x');
ylabel('y');

figure;
contour(x,y,z);
title('f2(x,y) contour');
xlabel('x');
ylabel('y');